What prefix for _canonical_uri?

61 views
Skip to first unread message

RA

unread,
Sep 22, 2019, 5:49:38 AM9/22/19
to TiddlyWiki
Trying to add FontAwesome as a plugin. The wiki is working, the plugin is recognized, and it contains shadow tiddlers for each svg file.
The only part I cannot get right is the _canonical_uri, so I get a "broken image" icon in each shadow tiddler instead of an svg image.

The documentation says "The URI can be absolute or relative to the HTML document."
What is the location of "HTML document" in case of Node.js? Is it where tiddlywiki.js is, or where tiddlywiki.info is? Or the current path in the shell where I'm launching the nodejs command from?
What should I set the prefix to? Is it even possible for _canonical_uri to point to a relative path that is outside the "HTML document"?

My wiki URL is
http://<ip address>:<port>/work

The tiddlywiki command:
nodejs /srv/TiddlyWiki5/app/tiddlywiki ++/srv/TiddlyWiki5/plugins/fontawesome /srv/TiddlyWiki5/wikis/work --listen host=0.0.0.0 port=8083 'root-tiddler=$:/core/save/lazy-all' 'path-prefix=/work'

Filesystem structure:
/srv/TiddlyWiki5/
  app
/tiddlywiki.js
  plugins
/fontawesome/tiddlywiki.files
  plugins
/fontawesome/svgs/regular/*.svg
  wikis/work/tiddlywiki.info
  wikis/work/tiddlers/*.tid

tiddlywiki.files (cannot get the prefix right):
{
   
"directories": [
       
{
           
"path": "svgs/regular",
           
"filesRegExp": "^.*\\.svg$",
           
"isTiddlerFile": false,
           
"fields": {
               
"title": {"source": "basename-uri-decoded"},
               
"created": {"source": "created"},
               
"modified": {"source": "modified"},
               
"type": "image/svg+xml",
               
"_canonical_uri": {"source": "filename", "prefix": "<what should I put here?>"}
           
}
       
}
   
]
}

Jeremy Ruston

unread,
Sep 22, 2019, 11:40:10 AM9/22/19
to tiddl...@googlegroups.com
Hi RA

Trying to add FontAwesome as a plugin. The wiki is working, the plugin is recognized, and it contains shadow tiddlers for each svg file.
The only part I cannot get right is the _canonical_uri, so I get a "broken image" icon in each shadow tiddler instead of an svg image.

If you’re using _canonical_uri, then the SVGs would also need to be exposed via HTTP. You could put them in the “files” folder of the wiki:


If you went that route you should be able to use `files/` as the prefix.

I’d be inclined to not bother with _canonical_uri, and instead embed the SVG text fields as shadow tiddlers.

Best wishes

Jeremy.

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/3fb7cd4b-7f02-4a96-b975-f909070de27f%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages