@Mohammad if the filter returns a path with an "/" in the file name, you
create a directory structure. The filter I gave is just an example and
users should customize according to their use case.
Also if you can add a link back to the tiddler on TW scripts that would be
very helpful.
Regards,
Saq
On Saturday, May 9, 2020 at 4:28:00 PM UTC+2, Mohammad wrote:
>
> Many thanks Saq, Briliant!
>
> This is really good! I will add this to TW-Scripts!
> I just missed the part you explained on storing tiddlers in different
> folders!
>
> --Mohammad
>
> On Saturday, May 9, 2020 at 5:05:59 PM UTC+4:30, Saq Imtiaz wrote:
>>
>> In summary, if anyone wants to write a guide, to adjust filenames and
>> links (for single file wikis) I recommend this process as per my current
>> understanding:
>>
>> 1. create a tiddler called $:/config/static/export-link-filter and
>> place here the filter that will operate on the tiddler title to transform
>> it as you like, this filter will receive the tiddler title as input. For
>> example:
>> [split[ ]join[-]encodeuricomponent[]addsuffix[.html]]
>>
>> 2. use this filter in the code for your export button:
>>
>>
>> \define actions-render-static-site()
>> <$action-sendmessage $message="tm-zip-create" $param=
>> "$:/temp/_ZipTiddler"/>
>> <$list filter="[all[tiddlers]!is[system]limit[100]]">
>> <$action-sendmessage $message="tm-zip-render-file" $param=
>> "$:/temp/_ZipTiddler" filename={{{ [<currentTiddler>subfilter{$:/config/
>> static/export-link-filter}] }}} tiddler=<<currentTiddler>> template=
>> "$:/core/templates/static.tiddler.html"/>
>> </$list>
>> <$action-sendmessage $message="tm-zip-render-file" $param="$:/temp/
>> _ZipTiddler" filename="static.css" template="$:/core/templates/static.
>> template.css"/>
>> <$action-sendmessage $message="tm-zip-download" $param="$:/temp/
>> _ZipTiddler" filename="myzip.zip"/>
>> \end
>>
>> <$button actions=<<actions-render-static-site>>>
>> Render site
>> </$button>
>>
>>
>> 3. Create a tiddler called $:/config/static/tv-filter-export-link, with
>> the tag $:/tags/Macro and the content:
>> \define tv-filter-export-link() [subfilter{$:/config/static/export-link-
>> filter}]
>>
>> This is the same process as what I outlined earlier *except, you write
>> the filter once and refer to it in both places*, reducing the chances of
>> error.
>>
>> Hope this helps,
>> Saq
>>
>
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/tiddlywiki/166113f6-6502-4693-b891-16f259c96a69%40googlegroups.com.