Published: 27.05.2021 | Edited: 27.05.2021 | Tags: 100daystooffload,journal

One disadvantage of git based blog

My statically generated blog (SSG) based on Sapper that is currently being phased out in favor of Svelte Kit that unfortunately takes too long to get into production phase is without any underlying database. This is nothing special and fairly common for other SSGs, as data are loaded directly from the Markdown files.

Some data, for instance post tags, are loaded from the special section at the top of the Markdown file called Front Matter. This section is generally written in some convenient language such as YAML or TOML. I have already written some details about the YAML Front Matter in and extended the thoughts and findings in the post about the UUIDs.

In that very post, I have also left links to my two other previous posts explaining I am retrieving creation and modification dates by following the git history. These types of data usually reside in the Front Matter too, but it is very convenient to have them generated automatically. In that post I also mention I have found someone else in the wild doing that too.

Zola static site generator

Recently I have stumbled upon Zola static site generator that is modeled after Hugo, but instead of Go it is written in Rust. I am a fan of Rust and want to force myself to learn some ting about it over time, so I have started exploring Zola. I have found it matching my preferences with it's features quite well, which was surprising.

What I have also found in this issue that there already a Zola fork that again extracts the dates from the commit history, but the implementation was not pulled upstream yet.

Should the dates be read from history?

The advantages of such configuration are plain: it is automated, no need to manually fix dates in the markdown file. Also, it forces myself to write on the given day - no excuses. This is a plus, if someone is into a habit building.

I have however found a pain point when trying to move the pages into Zola, currently to see how it plays out. The problem is that everything now has to be in a shared git history, for instance in a monorepo. Otherwise the history is lost. It does not suffice to just copy the Markdown files and tweak the Front Matter a little, because the date is completely missing from it.

Now this disadvantage is obvious thinking back, but it occurred to me just now. I am not planning to hassle with the fork at this stage, so I am exporting the data into the markdown for now. If I continued down this road, using Zola or something else instead of a Svelte based solution, maybe I could automate the markdown date keeping with something else in the future, for instance a beloved hooks.

This is a 78th post of #100daystooffload.