blog

lame subtitle

This is my blog. Do not expect frequent content.

Previous
Next

Writing a blog generator

12 April 2019 19:13 -04:00 / Permalink

I wanted to make this blog, and I wanted to make it simple and static. I considered other static site generators like Jekyll and Hugo, but I wasn't pleased with them. I wanted something dead simple that could parse some template files and some markdown files and put them together into a static site. So I made simple_blog.

simple_blog is exactly what it says on the tin. It makes a simple blog from a few files. It takes a configuration YAML file and generates a blog from it.

blog:
  title: blog
  subtitle: lame subtitle
  language: en-GB
  base_url: "/post/"

header:
  about_blurb: |
    This is my blog. Do not expect frequent content.
  links:
    - name: Gitlab
      url: https://gitlab.com/jkcclemens
    - name: GitHub
      url: https://github.com/jkcclemens

paths:
  output: public
  templates:
    dir: templates/**/*.html
    index: index.html
    post: post.html
  posts: posts

As you can see from the configuration, templates are in a directory called templates, and there are two types of templates: one for the index and one for posts. There's also a path for where the actual post markdown files are. Using that information, simple_blog parses the template files using Tera, then parses the markdown files using comrak, then renders the templates. That's all there is to it.

Things I want to do

I'm not 100% happy with how it works so far. I'd like to make a fork of comrak and make an extension for sidenotes. They look like this. I'd also like to clean up the simple_blog source a little bit, since right now it's all in one file and strung together quickly just to make it work.

Overall, I'm pleased with how it came together, though. Now I can write my one blog post every few years with a system that's super simple, and that's all I really wanted.