--render templates

109 views
Skip to first unread message

Jimmy Sweeney

unread,
Feb 26, 2021, 5:56:44 PM2/26/21
to TiddlyWiki
Hi all,

I'm hoping someone can help me out here. I'm trying to use the `--render` command to create HTML files from each tiddler.

What I'm having trouble with is using the "template" parameter that is discussed here.

What I want to do is access the tags of each individual tiddler while rendering the HTML files. I'd like the tags to show up at the top of the file in brackets.

For example, say I have a tiddler titled "For Whom The Bell Tolls" which is tagged
with "Books". I'd like the rendered HTML file to have [[Books]] at the top followed by the rest of the content of the tiddler.

Soren Bjornstad

unread,
Feb 27, 2021, 10:57:36 AM2/27/21
to TiddlyWiki
It's not 100% clear to me what the issue you're having is, but I think you want to make a template tiddler (call it MyTemplate) like this:

[[{{!!tags}}]]

<$transclude/>

Then you give MyTiddler as the value of the template parameter, and all the tiddlers you're rendering get rendered through this template tiddler.

Soren Bjornstad

unread,
Mar 1, 2021, 10:14:59 AM3/1/21
to TiddlyWiki
And of course, when I said “Then you give MyTiddler as the value of the template parameter,”, I meant “MyTemplate”, to match the title of the tiddler you created earlier.

Jimmy Sweeney

unread,
Mar 7, 2021, 10:22:41 PM3/7/21
to TiddlyWiki
Thank you! Since I wanted a pound sign before each of the tags, I ended up having to use this:

<$list filter="[all[current]tags[]!is[system]sort[title]]">#<$view field="title"/> </$list>

instead of:

[[{{!!tags}}]]

Thanks for your help.
Reply all
Reply to author
Forward
0 new messages