This repository houses a simple static blog engine that processes Markdown files, applies a templating system, and spits out a static blog in a directory. The engine is based on the following stack:
This stack is simple to initialize:
> conda create -n python36 python=3.6 virtualenv
> source activate python36
> virtualenv venv
> source venv/bin/activate
> pip install docopt Mako Markdown
I wanted to use a fast C-based parser, e.g., cmark-gfm
(link), but syntax highlighting looked difficult to implement without extra JavaScript libraries. Python Markdown is reasonably quick and includes a number of Markdown extensions (code highlighting, smart quotes, footnotes) out of the box.
- Render Markdown as HTML via simple templates.
- Be fast about it.
- Allow code syntax highlighting.
- Include MathJax or equivalent.
The engine works and already generates my blog.
Future upgrades and extensions:
-
Add better handling/factoring of configuration metadata.
This could be handled by testing for a dotfile or a local config file. -
Experiment with draft posts.
This might be best implemented as a YAML post flag such that the engine renders the HTML but does not include the post in any indexes (e.g., index.html, rss.xml, feed.json). -
Add better factoring of posts and template logic.
-
Add logging and timing to the page generation.
-
Add site generation and upload scripts to the repository.
-
Add logic to convert relative links to full ones fir the index page and feeds.