We had a similar problem over here in HackBo, our local hackerspace and in fact, I have used and enjoyed Grav before. But theme customization in it became really annoying and the sources of information started to be more spread: pictures and sounds in Internet Archive, quick Markdown notes in HedgeDoc and so on. So, inspired by static site generators like Grav or Pelican, but also dealing with their limitations regarding customized data sources and publishing workflows and overcomplicated tech stacks, I created Brea (repo/docs) a Pharo/GT powered and still alpha “middle place” between a static site generator and a decoupled CMS.
Now, with TiddlyWikiPharo, we are making some experiments on how to use TW as the dynamic editor for the static site generator. Our last interactive document shows how we are querying the wiki and manipulating the data to do versioning (in Fossil SCM) and for taking a subpart and creating the site.
For example, here are some snippets taken from the subsection related with converting from the wiki to the web site.
This would select all artist of a recent exposition
artists := microwiki tiddlers
select: [:tiddler | tiddler tags includesAll: #('Artista' 'Perfil') ]
The following snippet creates a “Dokuwiki” page of all the artist in the previous collection (I use Dokuwiki format as quick hack because its resemblance with WikiText, but future versions would use TiddlyWiki conversors running on Bun, a NodeJS alternative):
artistsPage := '' writeStream.
artists do: [:each |
artistsPage
nextPutAll: '===== ', each title, ' ====='; cr; cr;
nextPutAll: each text; cr; cr
].
artistsPage contents withInternetLineEndings
I convert the page with: pandoc --from dokuwiki --to markdown artistas.doku -o artistas.md
. And the next snippet takes the output page and inject into a particular page applying a given template:
artistsBreaPage := BreaPage new.
artistsBreaPage
shortName: 'artistas';
folder: siteFolder;
template: 'artistas.mus.html';
bodyTag: 'contenido'.
The output looks like this:
While the procedure still has important improvement to be made, being able to edit and define our site data mode quickly in TiddlyWiki, while having a domain specific language (DSL) made on a general purpose programming language, to query, manipulate and publish such TW data has proven a pretty useful and flexible approach, particularly suited to our particular needs and where we have the best of all worlds: TW emergent structure, Pharo powered interactive executable documentation and a fast and beautiful static site. There is still road ahead, but the path seems promising.