[Completed] Setting the domain for relative addresses

74 views
Skip to first unread message

TonyM

unread,
Jun 3, 2020, 5:04:35 AM6/3/20
to tiddl...@googlegroups.com
Folks,

If you export a html and it contains relative addresses if opened from another location they are all wrong.

There is a way to set the html or document root, in the html file, so all links become relative to that, ie below that address.

However for the life of me I cant google it with the correct terminology.

Can anyone help? Please

Why?
  • I realised with the internals plugin you get a raw html preview, this can be used to generate a snapshot of the generated html, ie a snapshot of the rendered tiddler, 
  • you can export this to a static html, all I need to do it to add back the domain path from which all links will be relative
  • By leveraging the same mechanisms of the internals plugin I hope to develop in wiki snapshots, and exportable html that links back to the source wiki.
Answer found and documented in this thread
 

Tony

TonyM

unread,
Jun 3, 2020, 10:46:54 PM6/3/20
to TiddlyWiki
Bump

He says desperately to continue building a snapshot utility.

Regards
Tony
Thanks in advance
 

Tony

TonyM

unread,
Jun 4, 2020, 8:55:21 PM6/4/20
to TiddlyWiki
The following answers my own Question

See https://www.w3schools.com/html/html_head.asp

The HTML <base> Element

The <base> element specifies the base URL and base target for all relative URLs in a page:

Example

<base href="https://www.w3schools.com/images/" target="_blank">
Example,

  • Export a tiddler as static html from tiddlywiki.com eg filter operators
  • Edit the html file, eg with notepad++ 
  • Add after the `<head>` tag
<base href="https://tiddlywiki.com" target="tiddlywiki.com">
save

Now open the saved static html in your browser. You have a quick load single tiddler, local html, with all the filter operators listed
However if you click on any link it will open the tiddler on tiddlywiki.com in the tab/window named target="tiddlywiki.com",

Every time you click a link it will open in the same tab. keeping your browser tabs from proliferating.

Regards
Tony


On Wednesday, June 3, 2020 at 7:04:35 PM UTC+10, TonyM wrote:
Thanks in advance
 

Tony
Reply all
Reply to author
Forward
0 new messages