Speaking with @kilomeow, we’re wondering if it would be possible to do static publishing of a TiddlyWiki on Fission, to a Fission site or folder, within the browser.
@Jermolene please let us know if you’re going to tinker with this. @kilomeow would like to flesh this out into something more proper, so any start would be great.
After little research, I found core/modules/commands/render.js which is repsonsible for producing static html files. The little problem here is that it’s only single tiddler method, but for a start we could just concatenate it.
So given tag blog and specific template we want to do something like:
var tiddlers = $tw.wiki.getTiddlersWithTag("blog");
result_html = "";
$tw.utils.each(tiddlers,function(title) {
var parser = wiki.parseTiddler(template),
variables = {currentTiddler: title};
var widgetNode = wiki.makeWidget(parser,{variables: variables}),
container = $tw.fakeDocument.createElement("div");
widgetNode.render(container,null);
result_html += container.innerHTML;
}
I don’t know yet if there will be any difficulties if I implement this as a plugin, I’ll give a try
Hi @kilomeow that’s along the right lines. The core JSZip plugin does something similar for rendering static sites into a ZIP file:
Getting a proof of concept up and running shouldn’t be too difficult. I’ll make the TiddlyWiki on Fission repository public in the next couple of days which should make a reasonable test bed for your experiments.
I’d like to get to the point where TW has a “publish” button next to “save changes”, that invokes a generic framework to generate a static site from a sitemap and pushes it to Fission, a ZIP file, or the file system on Node.js.
The very early version of the FissionPublisher plugin is available! Check out the demo.
At the moment it allows you to simply export tidlers with the desired tag as a static html:
There is still a lot of work to do - add the export of tiddlers as separate pages, add links between, a disqus/commento/whatever comments under the posts. I want to look a bit more how is done Anne-Laure’s digital garden (and disassemble JSZip core plugin).
However my next will be towards webnative – let’s try to create new fission application from tiddlywiki based on @Jermolene developments.
Hello @Jermolene ! There have been several updates in the TW on Fission since our last talk. It is noticeable that you added a static publishing edition and also some new functions for publishing. I want to finish my publishing plugin to get it work with Fission in a way that it will create individual fission app and publish blog content there. What is preferred next step? Add tm-fission-create-app and tm-fission-publish to startup.js or work on fission-publisher.js ?
Also after James talk on Stork I think it’s must have to enable Stork as a search option for a static published websites on Fission. Specifically Stork’s index building could be included to publishing process and client-side js/wasm just bundled to the blog template.