Render macro to static html

69 views
Skip to first unread message

Scott Kingery

unread,
Mar 15, 2021, 7:09:31 PM3/15/21
to TiddlyWiki
I'm working on a static site. It works fine but I thought I'd try and make it a little more generic/flexible by grabbing the color from <<colour primary>>

Tough to explain but here we go...
I created a tiddler called $:/primary
In primary I put:
<$wikify name="output" text=<<colour primary>> mode="inline" output="html">
<$text text=<<output>>/>
</$wikify>

In my custom static.template.html I put:
{{$:/primary}}

This renders when I look at my static.template.html through tiddlywiki but {{$:/primary}} doesn't render when the static file is generated. Well, it does render but it is blank because it isn't pulling in the result of the <<colour primary>> like I want.

Can this be done?
Thanks

Saq Imtiaz

unread,
Mar 16, 2021, 2:01:48 AM3/16/21
to TiddlyWiki
Does your static.template.html import global macros?

Try adding this at the very beginning of it:

\import [[$:/core/ui/PageMacros]] [all[shadows+tiddlers]tag[$:/tags/Macro]!has[draft.of]]

Scott Kingery

unread,
Mar 16, 2021, 4:32:48 PM3/16/21
to tiddl...@googlegroups.com
Saq,
Exactly what I needed. Thank you!

Scott
> --
> You received this message because you are subscribed to a topic in the Google Groups "TiddlyWiki" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/tiddlywiki/p8wwuXnj7XA/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to tiddlywiki+...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/3f1f8b9a-d7ec-4868-ad07-ce62a97e8799n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages