Migrating my blog from Gatsby to a static site with Cryogen and AsciiDoctor
A year ago I have moved my blog from Wordpress and its WYSIWYG editor to a static site written using React and GaphQL and generated by Gatsby, with entries in Markdown, hosted on Netlify. My motivation was control and ease of writing. Now I continue the trend by moving from Gatsby to Cryogen, a blog-focused static site generator in Clojure, and AsciiDoctor.
We use Gatsby at work for Telia’s cellphone B2B webshop and it is a perfect match - the site is very interactive and (statically generated) React makes a lot of sense there.
Cryogen is a tiny tool with great documentation and a responsive and welcoming maintainer and it is written in Clojure, the language that I enjoy most of all.
I also decided to move from Markdown to AsciiDoctor - it is better defined and has a richer feature set, providing out-of-the-box some functionality that I missed before (or had to use Gatsby plugins for), such as the ability to assign custom classes to code blocks, IDs to headings, better ability to mix HTML and the markup,
<aside>. See the short overview at AsciiDoc vs Markdown and Why You Shouldn’t Use “Markdown” for Documentation.
The code for migrating from Gatsby to Cryogen is in the blog repo:
content/tmp-migration/old/md/is the old Gatsby content
to-adoc.fish runs Pandoc with a custom template and a filter to transform the content from .md to .asc and then the babashka (scripting in ± Clojure) script fix-files.clj to fix Cryogen metadata blocks and other things
tmp-migration/combine-all.shmoves the content to where it should be