About blohg

Blohg is a blog engine written in Python.

It has Flask, Jinja2, docutils, Mercurial in its basis. Comment system is external, via disqus.

For me it has this advantages:

  • reStructuredText - it has more capabilities than, for example, Markdown.
  • Mercurial - It's convinient to post - edit, hg commit, hg push (but there's no capability to post from browser yet, probably I will make this possible).


I don't like to describe how to install something, but in gentoo it's just one command (Rafael G. Martins - author of blohg - is gentoo developer) (while I looked at his site, I saw many goodies, I'll try to get to know them and describe here):

$ emerge blohg


Create repository:

$ blohg initrepo --repo-path my_blohg

Set up settings in config.yaml, tune up templates (in templates directory).

After that, write posts (in content/post directory), create attachments (in content/attachments) and commit changes.


Clone repo to remote host:

$ hg clone my_blohg ssh://user@yourdomain.tld/path/to/my_blohg/

I use lighttpd as web-server.


fastcgi.debug = 0

fastcgi.server = ("/" =>
       "blohg" => (
        "socket" => "/tmp/blohg-fcgi.sock",
        "bin-path" => "/var/www/blohg.fcgi",
        "check-local" => "disable",
        "fix-root-scriptname" => "enable"

alias.url = (
    "/static/" => "/var/www/blog/static"

url.rewrite-once = (
    "^(/static.*)$" => "$1",
    "^(/favicon.ico.*)$" => "/static$1",

Contents of /var/www/blohg.fcgi (python module flup is needed):

from flup.server.fcgi import WSGIServer
from blohg import create_app

if __name__ == '__main__':
    application = create_app('/path/to/my_blohg')


In post about my server I wanted to make strikeout text, but sadly reStructuredText don't support that. I patched docutils, here's a patch. But I want to move this functionality to blohg.

UPD: Done, changeset.

UPD2: Done properly. There is standard way to define custom roles which only adds class to <span> tag:

.. role:: strikeout
   :class: strikeout

Or you can add a block to container with strikeout class:

.. container::
   :class: strikeout

I made a fork of blohg on http://bitbucket.org, to publish my changes: fork. More precisely, I made a fork of Ry4an's repository, because Rafael serves hg repository from his own server.

Looked at rst-resume, I want to publish my resume at this site.

blog comments powered by Disqus