For over a year now there has been this debate about how to relaunch the website of my employer The use of static website generators was brought into the discussion, and the arguments for this technique are quite compelling. This is my second attempt on giving a project a closer look (the first one was Hyde).

choosing a generator

Starting from this website I sorted all the projects by the programing language they are written in. Since I prefer python over any other scripting language (so far) I went through all the projects written in python.

My next step was to find projects that seemed to be alive (like updates that are fresher than a year). Browsing the resulting list I stumbled across Pelican because it had not only all the features I was looking for but also an amazing number of stars.

So I followed the excellent documentation and about 45 minutes later I sat and started to write this article.

Well, of course a lot more time passed until the site looked the way it looks now, but considering what I did the few hours were spent very productive.

importing wordpress

For a while I used a wordpress blog parallel to my static website. These two are combined at this site now and that was actually the easy part, using pelican-import. First I had to export all the posts to an XML-file, but that is a built-in feature of wordpress. The next line created Markdown formatted files from all my posts:

pelican-import --markup markdown --wpfile -o output path-to-wordpress.xml

All the images had to be exported by other means and then I had to fix all the articles that contained images to point to the new (static) location instead of to the still running wordpress site.

migrating my old site

My previous website was just static html, pieced together over the course of time. Fortunately I only had few pages and these where quickly transferred.

cool facts

The things that made me stay with pelican are quite a few. First of all, following the documentation, installation was easy and setting up a first demo site was a question of minutes. The tools all work as described and as expected.

While working on the site you can choose between manually generating html whenever you like, or using the regenerate make target that will continuously render the output whenever you change something. That is of course not only true for modifying content but also for changes in themes or plugins. And if you do not want to use a web server on your development computer, you can just tell pelican to server your page at port 8000 for you to look at.

Pelican looks like a living project with a great number of people contributing. Just look at the number of plugins and themes available, all of them conveniently accessible by using git.

So if you are looking for a static site generator, give pelican a try.