Change invidious server address for all Links - How to build Links with variables?

For a tiddlywiki in which i want to present quid a few links to YT Videos i like to use instead invidious - https://invidious.io - links to the Videos.

Now I’m looking for an option to change easy all links to a particular invidious server address when ever it is needed or wanted …
__

So in all the tiddlers a markdown link to a video looks always like this:

[![TEXT](http:///an-invidious-server.tld/vi/VIDEO-ID/mqdefault.jpg)](https://an-invidious-server.tld/watch?v=VIDEO-ID)
e.g.
[![ Introduction To TiddlyWiki](upload://y4Hg6g2hvQI9lVlIF4TXjLntuTn.jpeg)](https://vid.puffyan.us/watch?v=kd935uJOxXc)

( turns out to Introduction To TiddlyWiki )

Now i would like to have the option to change the part “an-invidious-server.tld” of all links in all the tiddlers of a wiki with just one setting.

so the links

http:///an-invidious-server.tld/vi/VIDEO-ID/mqdefault.jpg
https://an-invidious-server.tld/watch?v=VIDEO-ID

have to be build with a variable for “an-invidious-server.tld”

Is there an option to build LINKs in a TiddlyWiki like that ?

Thanks for your help

an other way to do it would be the use of a search-replace operation
i found this:

https://tiddlywiki.com/#search-replace%20Operator

and the great TW-Commander plugin

https://kookma.github.io/TW-Commander/

there we have a “Search and replace” option for all tiddlers of a wiki if we use the “Replace all ?” button.

Nice…

wonder how i could predefined a “Search and replace” widget for a particular URL

You can use string Operators (such as removeprefix, addprefix, removesuffix, addsuffix, search-relpace) and the join Operator to assemble a url out of components, or to reconfigure strings within it.

For example, I have dropbox links that all need the conversion of the default suffix to one that allows inline embedding of content:

<a target=_blank href={{{ [{!!ddl-url}] +[removesuffix[dl=0]] +[addsuffix[raw=1]] }}}>

Something analogous ought to work for you.

1 Like

I have thought for some time that perhaps when we import links, we extract the domain and generate a domain tiddler or variable, and instead store the link as a protocol and domain variable+the folder, fragment filename (if not index.html).

This would allow;

  • The domain to be “moved” or renamed updating all links using it
  • Gain access to all links addressed to that domain in one view

I am not sure how, YET.