This project was born out of frustration with manually editing html files for this website and the hope that simplifying the process would encourage me to post more often. The solution was to create a basic static site generator - a well-trodden path with many robust alternatives, but a fun challenge during the early days of the COVID-19 pandemic.

I also used this project as an opportunity to learn Rust, a systems programming language known for performance and safety. Although the project didn't require Rusts power, it was a chance to expand my skills and tackle the challenges of a lower-level language.

Overview

The goal was simplicity. Since most pages follow a similar structure, I decided to use a custom markdown-like syntax for input files. The generator works as follows:

1. Take a directory of markdown files.

2. Convert each into an html file.

3. Output these files along with required assets and static content.

Currently, the parser supports a subset of markdown features, including text, subheadings, images, code blocks, and inline code.

Challenges

Learning Rust was the most significant challenge. The borrow checker and lifetimes were initially tough, but over time, I adapted to and appreciated the language's design. Rust forced me to think carefully about ownership and structure, which ultimately improved my programming approach.

Project-specific challenges included maintaining simplicity. Embedding metadata in a hidden header of each markdown file allowed all page data to remain in one place. This metadata is used for file naming, tags, and post ordering. Except for the index and archive pages, all site pages are dynamically generated from markdown files.

Result

The project resulted in a functional static site generator and a solid introduction to Rust - success on two fronts. However, it has not increased my posting frequency, proving that reducing friction isnt the sole solution to writers block. Still, Im pleased to have achieved one of my goals.

Project Resources

The code for this project is available on GitHub.