Sky Watch

Another Statically Generated Blog

Two weeks ago I decided to open another blog. I was tired of Hyde because its codebase is too big for me, so I decided to write my own. So I made Blogsair. It is a Flask application in the core. It uses Flask-FlatPages to process Markdown, and Frozen-Flask to convert the blog to static code. It contains about only 100 lines of Python code.

I have used virtually the same template as in the Hyde code. My new blog is in Chinese, which is very different from English typographically, so I had to prepare different CSS codes for it. Now in each post I can specify the language of the article, and the proper CSS will be loaded.

One issue was that in Hyde, each post is part of the template, which means one can reference variables in the article. In Blogsair, posts are processed with FlatPages instead of a template engine, so I had to implement a very quick and dirty variable system, so that in a post I can write something like

![The red button](\{\{ url_for('static', filename="img/2012/DSC_0054.jpg") \}\})