Boris Smus

interaction engineering

Short posts using split Markdown

Lightning, the static blog generator that powers this site, is awesome for long form content. But it does not work well for short form content, since creating each post requires a bunch of up-front effort:

  1. I navigate to the right place, recalling the current year (!) and deciding on the slug for the post (eg. content/posts/2017/how-to-fix-the-world).

  2. I manually create the index.md file and then specify the redundant human-readable title and the posted date within it:

    How to Fix the World
    ===
    posted: May 28, 2017
    
    Listen to me, I have the answers.
    

After writing the post, the title will inevitably have changed, so I rename the slug to match: mv how-to-fix-the-world how-to-slightly-improve-the-world. Finally I publish and tweet, and hopefully the world becomes infinitesimally better.

I once tried to make it easier to keep a lightning-style link blog, but ended up scrapping the solution because it was buggy and required a Mac.

Split markdown pages

My aim was to remove the up-front costs I described above. Appending to the top of an existing file and having the engine automatically generate a slug based on the title seemed like the right approach. This means that one markdown file results in multiple HTML pages. The latest Lightning has been updated with split markdown files, and refactored into classes, making it easier to add features in the future. To give a sense of what these split markdown files look like, take a look at this file.

Split markdown files power two new sections on this site: a [book reviews section]books, and a notes section. I'm hoping that this added convenience will encourage me to write shorter, more focused posts with increasing frequency.