Dimma's web corner 🚂🚃🚃🚃

Typst as site generator

Typst 0.15 got some cool stuff! Mainly, it's now possible to generate multiple documents without extra software hackery around Typst, meaning using it as site generator is now easier.

This satisfies my itch of wanting a proper programming language to generate my sites with. There's even proper MathML now for the export! No need to drag in the entirety of KaTeX for each page now.

Unfortunately I haven't really found a nice way to embed assets from pages just yet:

#document("index.html")[
  = Hello world!
  A text! and an image:
  // fails here! because #document isn't a "bundle"
  #asset("asset.png", read("asset.png", encoding: none))
]

// but putting it here does work!
#asset("asset.png", read("asset.png", encoding: none))

But I assume this can be solved with some creativity. For now, images are still embedded directly into the HTML file as a base64 encoded string, which is a choice, but this may be resolved by Typst in the future. If not, show rules can probably help with it too.

The only downside I can see so far is that Typst's syntax highlighter doesn't output classes to HTML, and instead outputs the colors directly. Zola can now get around this, but it is a limitation if (when?) I do go to Typst.

I also still wanna redo the CSS of the webbed site so it's not all just a single white page, and replace the current train with an actual drawing of something.