I rewrote this blog recently with the following aims:
- to make it as easy as possible to create a new article, using reStructuredText (RST) as the base for each article;
- to clean up and simplify the design, focussing on the readability of articles that include code snippets.
I knew that there were various static blogs out there, with many supporting RST, but I still fancied the challenge of crafting something specific to my needs. There's nothing wrong with wheel re-invention if you want to learn about wheels.
This article is a short summary.
Django, Fabric and pygments - the source is on github. I intend to pull out the generic blogging code into a separate library, reStructuredBlog, at some point, hence the "rsb" acronym used in the codebase.
Writing a post
My ideal for writing a blog post is:
- Use vim to create a .rst file for the article;
- Preview the article locally;
- Publish to the remote server
This translates to:
./manage.py rsb_article posts/my-new-article.rst ./manage.py runserver
This converts the RST file into a instance of rsb.models.Article, plucking out the title, subtitle and any tags in the process.
Rinse and repeat the write and preview steps until happy.
fab prod publish posts/0036-my-new-article.rst
This copies the RST file up to the remote server and re-runs the rsb_article management command to create the article in the production database.
I recently read the excellent "Design for Hackers" by David Kadavy. Duly inspired, I attempted to rework the design to be clean and pleasing on the eye. The color scheme is deliberately kept simple; the fonts used are Verdana, Droid Serif and Inconsolata.
I'm pleased that:
- The site isn't painfully ugly like the old;
- I can write articles easily and using my favourite tools (vim + RST);
- I can write articles on the tube on the way home;
- Github is now my backup of both code and content. For instance, you can view the source of this article.
Since I switched to Disqus for comments, I decided to drop all the old ones (not that were that many), since I wasn't sure it was possible to migrate Apologies to the comment authors.