I recently migrated the website from Markdown+Hugo entirely to Typst1. Typst is a typesetting system that is fast and easy to use, at least personally, compared to LaTeX. It’s complex and can handle things like figures and scripting easily:
#let mycircle(i) = [
#circle(fill: blue.lighten(80%), stroke: 1pt + black)[
#align(center + horizon)[
Figure #i
]
]
]
#figure[
#drawing[
#for i in range(0,3) [
#box[#mycircle(i)]
]
]
]Which generates:
Function mycircle has square brackets, meaning it outputs “content” that can be displayed, for example, a circle. Scripting is straightforward loops and ifs, the ones that already look familiar to you, not some weird looking ones.
You can also embed font icons, or use packages you already know from Typst:
#align(center)[
#grid(columns: 3, column-gutter: 1cm,
box(ti("calendar", size: 1cm)),
box(ti("school", size: 1cm)),
box(ti("user", size: 1cm)),
)
]And even if you miss a simple comma, don’t worry, output errors are simple to read:
error: expected comma
┌─ src/posts/0018-a-new-dawn-in-typst.typ:62:27
│
62 │ ti("school", size: 1cm)
│What I like from Typst is that you can still achieve complex drawings or scriptings, but with a sane and fast syntax. I’ve adopted it for my Master Thesis, writings, presentations, and I was missing the blogpost! After writing so much in Typst I always hated going back to Hugo, mostly due to its limitations. If I wanted to draw something I needed to draw it externally and include it as a SVG/PDF/PNG/JPG, having to switch languages to Typst or TeX for the figure. With Typst HTML export I can just have everything on a single file, same language, and with a tight integration. If I write a presentation and make a cool figure for it, I can import it entirely, or building blocks of it, as functions to the blogpost and re-use it everywhere. I can also build a local package with macros and use it on presentations, articles, and now, the blog.
Finally, I also took time and migrated the infrastructure. Due to the recent price adjustments of Hetzner, and the fact that I was not using the server too much, I migrated the website to Cloudflare Pages for now.
