Almost a year and a half ago, I wrote about how I had built my own blog frameworky thing. In that post I wrote that I was happy with the result. Unfortunately, it didn’t last long.
The problem was that the tool I had built did too much. It found all the markdown files, converted them to HTML using Mustache templates and wrote the result to other files. All paths etcetera were hardcoded, the code was tied to the content in a way I strongly diskliked. Each change required everything to be rebuilt. Come to think of it, the only thing I liked was the choices of templating technology I had picked - Markdown and Mustache.
Over the last years, I have come to realize that I like make, basically because it’s fast, it’s available everywhere, it can run things in parallell and it’s really good at handling file dependencies. So, instead of always rebuilding everything, I wanted a makefile for my blog to look something like:
PAGES_SRC_FILES=$(wildcard site_src/pages/*.markdown) PAGES_BUILD_FILES=$(patsubst site_src/pages/%.markdown, $(BUILD_DIR)/pages/%.html, $(PAGES_SRC_FILES)) $(BUILD_DIR)/blog/%.html: site_src/blog/%.markdown build-a-blog-page --template blog-template.mustache $< >$@
So, realizing that this would be a good way to design my tool outside-in, I wrote a complete Makefile, specifying how I wanted the “build-a-blog-page” to work.
Redesigning my tool did take a while, as the new version looks very little like the old one. It is still written in Python, as I find the Markdown support with Metadata and CodeHilite very nice. I have named the result Sinor. It is not a complete blogging framework, but it will convert Markdown to HTML, as well as generate Atom feeds and archive pages. What’s not to like?
I have tried to be as clear as possible in the README on how to use it, Thanks to Jimmy for helping me proofread it.
This is my first pip package, so I might have messed it up totally, but it worked when I tested it. I am planning to release an AUR package for Arch Linux as well. Anyways, perhaps someone else will like it. If so, enjoy.