I'm testing a new version of my personal site/blog using a static site generator called pelican. It's built on Python. My current (soon to be previous) site used a Haskell based static site generator hakyll which I liked a lot. One downside to Hakyll is that you need GHC and a handfull of packages for it that clock in at many, many megabytes. That, and the fact that you can't link the hakyll executable with less than a gigabyte of RAM (I'm exagerating, but you get my point). I love haskell and GHC, but I think it's overkill to depend on them just to generate some HTML for a very simple website.

Virtual Python Environments

Along the way I learned some useful stuff about using sandboxed Python development environments using virtualenv. This is how I get pelican up and running (on OS X):

$ sudo pip install virtualenv
$ mkdir ~/.virtualenvs; cd ~/.virtualenvs
$ mkdir blog
$ virtualenv blog
$ cd blog
$ source bin/activate
(blog) $ pip install pelican markdown

At this point I've got all the python dependencies for pelican and the pelican executable all stored and sandboxed under ~/.virtualenvs. When I want to generate the HTML for my site, I have to activate the virtual environment first (which is easy to remember, since if I try without activating first, pelican won't be in the path!)


I hacked around on the chunk theme. I didn't like the blogroll links showing up in the top level menu, so I removed this Jinja block from themes/chunk/templates/base.html:

{% if LINKS %}
  {% for name, url in LINKS %}
    <li  class="active" class="menu-item menu-item-type-post_type menu-item-object-page"><a href="{{ url }}">{{ name }}</a></li>
  {% endfor %}
{% endif %}


comments powered by Disqus