About blohg

blohg is a Mercurial (or alternatively Git) based blogging engine written in Python, built on the top of the Flask micro-framework and some of its extensions. All the content of the blogs are stored inside a repository, and its history is used to build the posts and pages.

Motivation

Everybody knows that we have a large number of blogging engines lying around the blogosphere, but there are not a many choices for programmers, who are used to working daily with source-code editors and version control systems and may be more productive when blogging using these tools, instead of the fancy WYSIWYG editors and administration interfaces.

Actually this isn’t the first project trying to implement a VCS-based blogging engine, but most of the existing projects aren’t tied to a VCS and are just using text files that can be versioned with a VCS, without taking full advantage of the VCS’s revision history.

This project uses Mercurial as the VCS, reStructuredText as the markup language and Jinja2 as the template engine. All of these are pretty popular within the Python ecosystem and easy to use.

Basic concepts

Here are some of the basic concepts needed to understand how blohg works: In addition, you should know how Mercurial works, the reStructuredText syntax and the Jinja2 syntax.

Pages

Pages are static content, such as an “About me” page. They aren’t listed in atom feeds or in the home view. You may want to create a menu entry manually in the template to them. Pages are .rst files stored in any directory inside content/, excluding content/post/. Sub-directories are allowed.

Posts

Posts are the dynamic content of a blog. They are shown on the home page and atom feeds, ordered by publication date, descendant. Posts should be stored inside the directory content/post/. Sub-directories are allowed.

Tags

Tags are identifiers that are used to classify posts by topic. Each tag generates a HTML page and an atom feed with related posts. Tags aren’t allowed in pages, only posts.

Main features

These are some of the cool features of blohg:

  • Support for static pages and posts.
  • Support for tags for posts.
  • Support for aliases, making it easy to migrate from some other blogging engine.
  • Support for building a static version of the blog, to host it in restricted environments.
  • Post/page metadata grabbed from the Mercurial repository.
  • Plenty of reStructuredText directives available, to make the blogging experience as smooth as possible.
  • Easily customizable by Jinja2 templates.
  • Can be used as a full-featured CMS.
  • Support for pagination for posts.
  • Atom feeds for posts and tags.