Hello, Possibilia
This is the first post: a short explanation of why the site exists and what
happens when you run make.
I wanted a blog that felt closer to a text file than a web application. The whole publishing workflow is:
- Write a Markdown file.
- Add one line to the blog index.
- Run
make.
That is the entire ceremony. The output is a set of static HTML files, which can be served by anything from GitHub Pages to a tiny server in the closet.
The build
The generator follows an old idea: let the filesystem and make handle the
dependency graph, and keep the templates boring. The Markdown itself is
rendered by cmark, the same parser Matt's Makefile uses.
def build():
site = load_site()
posts = parse_entries("blog") + parse_entries("projects")
for page in sorted(CONTENT.rglob("*.md")):
render_page(page, site, posts)
write_feed(site, posts)
A static site generator is mostly a set of conventions pretending to be a program.
The conventions here are:
- The first line of every page is a single
#heading. It labels the section in the top bar. - The first
##heading becomes the page title. - Blog and project indexes use small template directives to list entries.
- Everything else is ordinary Markdown.
Why not a framework?
A framework would be fine. But the smaller the tool, the easier it is to understand at a glance, and the less likely it is to rot while I am not looking.
If you want to make it yours, start with home.html and style.css. The rest
is just text.