🚀 TwoFold v0.12

I had to push myself to write this blog post, had to wrestle my laziness and force myself to put fingers to keyboard 😂.

I just released TwoFold v0.12! This release is a big deal for me, as it's packed with some major under-the-hood changes.
I completely re-written the tag evaluation, built a new abstract syntax tree structure, a few new tags and one new addon called "intoVar".
There's also a new template engine called "TemplateEngine" (very inspired name, I know), which is more advanced than the old "Templite" engine.
I've also taken the opportunity to tidy up some of the existing tags, renaming "import" to "evaluate" and "dir" to "dirList" to make their purposes more explicit. It's the little things, folks!

The main goal with this release was to be able to use TwoFold as a static website generator, and now it works!
My MEMEX notes are now generated with TwoFold and you shouldn't see almost any difference on my website.
I used to generate them with Eleventy (11ty.io), but now I can proudly say that TwoFold is up to the job.
I didn't rewrite everything yet, so my website is a Frankenstein of code right now, but I'm getting there.

A memex entry looks rougly like this:

〈mem〉
〈title〉Whatever〈/title〉
In: 〈link〉[Something](./something)〈/link〉.
〈backlinks〉Whatever〈/backlinks〉
This is the body of this entry, blah blah.
〈/mem〉

All the memex entries are cached using TwoFold's DiskCache, and I can populate the back-links (showing what notes are mentioning the current note). The body of the entry is converted from Markdown to HTML, and it all fits into a wiki.htm template using the new "TemplateEngine". It's a really clean implementation.

And a blog entry looks rougly like this:

〈blog〉
〈toml〉
date = "2025-01-23"
title = "Some title"
tags = ["tag1", "tag2]
〈/toml〉
This is the body of this blog post, blah blah.
〈/blog〉

Obviously, I had to implement the custom tags logic for 〈mem〉 and 〈blog〉, but that's a few hundred lines of code. The implementation is very similar for both memex and blog tags.
( I completely rewrote all my public notes in the new format, so I can't publish anything without TwoFold now 😂 )
The posts are cached on disk and I'm using it to generate the list of recent posts, tags, topics & so on.

One Markdown file can contain multiple memex entries or blog posts in this format, and it doesn't matter because I just evaluate all the files in the folder with the new "evaluateAll" tag: 〈evaluateAll src="mem/*.md"〉〈/evaluateAll〉.

I'm super happy with how everything turned out, and I'm excited that I can make TwoFold even more useful than before.

I'll take a longer break now. I'll probably work on img-DB next, not sure. I need some time to think.

@notes #trinkets #twofold #project