A way to make Canonical URI more flexible?

134 views
Skip to first unread message

Mark S.

unread,
Apr 24, 2016, 2:15:28 PM4/24/16
to TiddlyWiki
Is there a way to easily change the base path of  _canonical_uri ?

I tried something easy like this, but of course it didn't work:

{{$:/MAS/DefaultImagePath}}/2016/maps/map-satel-nwlr2-folo-stalewater.png

But maybe there's some other way to do this with macros or templates?

Thanks!
Mark

Jeremy Ruston

unread,
Apr 25, 2016, 3:45:18 AM4/25/16
to tiddl...@googlegroups.com
Hi Mark

Is there a way to easily change the base path of  _canonical_uri ?

There’s no such capability at the moment, but it’s an interesting suggestion.

As a quick fix, you may be able to use the HTML <base> element:


Best wishes

Jeremy.



I tried something easy like this, but of course it didn't work:

{{$:/MAS/DefaultImagePath}}/2016/maps/map-satel-nwlr2-folo-stalewater.png

But maybe there's some other way to do this with macros or templates?

Thanks!
Mark


--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/5de478b8-e4e8-40c8-87ad-82a34885075b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Mark S.

unread,
Apr 25, 2016, 11:33:00 AM4/25/16
to TiddlyWiki
Hello Jeremy,

I hacked a test TW, and found that I could change the base with <base>.

So the question is, is there any tiddler where I could put the HTML <base> code and have it invoked when the TW is loaded? Manually hacking the source code is a bit inconvenient.

Changing <base> also changes the base of any relative external links. So you would have to choose between getting _canonical_uri right or getting your links right.

Ideally you would have multiple bases, and images using _canonical_uri would switch bases depending on tags or other criteria.

The point of all this is to make it possible to use TW on different platforms where resources (images, pdfs, etc.)  may have to reside in completely different locations.

Thanks!
Mark

Jeremy Ruston

unread,
Apr 25, 2016, 12:19:12 PM4/25/16
to tiddl...@googlegroups.com
Hi Mark

So the question is, is there any tiddler where I could put the HTML <base> code and have it invoked when the TW is loaded? Manually hacking the source code is a bit inconvenient.

Try creating a tiddler tagged $:/tags/RawMarkup containing the <base> tag.

Changing <base> also changes the base of any relative external links. So you would have to choose between getting _canonical_uri right or getting your links right.

Yes indeed, it’s a bit of a blunt solution, but hopefully will allow you to some exploring.

Ideally you would have multiple bases, and images using _canonical_uri would switch bases depending on tags or other criteria.

Yes, one could imagine introducing a new _canonical_uri_base field that contains the name of a tiddler containing the base URI for interpreting the _canonical_uri field.

The point of all this is to make it possible to use TW on different platforms where resources (images, pdfs, etc.)  may have to reside in completely different locations.

I agree it’s an important use case.

Best wishes

Jeremy

Mark S.

unread,
Apr 25, 2016, 2:04:20 PM4/25/16
to TiddlyWiki
Hi Jeremy,

That seems to work -- and it turns out to be pretty important -- TW wrote over (fixed?) my hand edited code when I saved!

Thanks again,
Mark


On Monday, April 25, 2016 at 9:19:12 AM UTC-7, Jeremy Ruston wrote:
Hi Mark

Jeremy Ruston

unread,
Apr 26, 2016, 3:30:12 AM4/26/16
to tiddl...@googlegroups.com
Hi Mark

That seems to work -- and it turns out to be pretty important -- TW wrote over (fixed?) my hand edited code when I saved!

Yes; don’t forget that TiddlyWiki is a Quine. When you save changes, it is actually regenerating its own source code, and saving that over the top of itself.

Best wishes

Jeremy


Thanks again,
Mark

On Monday, April 25, 2016 at 9:19:12 AM UTC-7, Jeremy Ruston wrote:
Hi Mark

So the question is, is there any tiddler where I could put the HTML <base> code and have it invoked when the TW is loaded? Manually hacking the source code is a bit inconvenient.

Try creating a tiddler tagged $:/tags/RawMarkup containing the <base> tag.



--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
Reply all
Reply to author
Forward
0 new messages