Exclude tiddlers by field from buid index render

Hi,
I’m using TW with Node.js (not sure yet if I’m using it the right way or not), there’s a lot to learn, and I’ve reached the point where I’ve set up a local network with Nextcloud for the computers, and I’m using Tiddloid to edit with the slavephone. The next day, I import those notes.
But I want to exclude tiddlers with the field status: review (or something like that) from the dist/index.html.

Is there a way to do this? This is what I have (I think I’ve installed the empty version):

"build": {
        "index": [
            "--render",
            "$:/plugins/tiddlywiki/tiddlyweb/save/offline",
            "index.html",
            "text/plain"
        ],

And this is what I tried:

    "build": {
        "index": [
            "--render",
              "[!field:status[review]]",
            "$:/plugins/tiddlywiki/tiddlyweb/save/offline",
            "index.html",
            "text/plain"
        ],

The result is that the tiddler with that field still shows up in dist/index.html, and all tiddlers are not editable.

Thanks!

You’ll need to either override the shadow tiddler $:/plugins/tiddlywiki/tiddlyweb/save/offline to add your additional filter there, or add a new one. If we were to add a new one, say, $:/plugins/tiddlywiki/tiddlyweb/save/offline-no-review it might look like this:

\import [subfilter{$:/core/config/GlobalImportFilter}]
\define saveTiddlerFilter()
[is[tiddler]] -[[$:/boot/boot.css]] -[prefix[$:/HistoryList]] -[status[pending]plugin-type[import]] 
-[type[application/javascript]library[yes]] -[[$:/boot/boot.js]] -[[$:/boot/bootprefix.js]] 
-[[$:/plugins/tiddlywiki/filesystem]] -[[$:/plugins/tiddlywiki/tiddlyweb]] -[prefix[$:/temp/]] 
:filter[!field:status[review]]  +[sort[title]] $(publishFilter)$ 
\end
{{$:/core/templates/tiddlywiki5.html}}

And then we can override the index entry of tiddlywiki.info, or add a new one like this:

        "index-no-review": [
            "--render",
            "$:/plugins/tiddlywiki/tiddlyweb/save/offline-no-review",
            "index.html",
            "text/plain"
        ],

and then when we run tiddlywiki path/to/wiki --build index-no-review, you should get the result you’re looking for.



(Sorry for the slow response; just back from vacation.)

1 Like