Dominik Meyer

Personal Page

This Website

I wanted to have a personal website. Common solutions, like for example a wordpress blog were no option for me, since I didn't want to install any scripting language on this server. All the complicated updating and monitoring of security mailinglists is just too much of a hassle. Also I didn't want to rely on some commercial or ad-financed company providing personal blog pages. So, whats the solution -- a static website.

Coding a fully static website with all the design and directly typesetting articles in HTML is also no option. Luckly, others have similar problems and a wide range of solutions, generating static websites using a theme and restructured source files, exist.

The first solution I had a look at was Hakyll. It is implemented in Haskell and although I really like functional programming, having to install a ~1GB development environment and packages was just too much of an overkill for me. Also I wanted something easy to handle and lightweight. Python is installed on all my machines anyways, so therefore I opted for the Python-based solution Pelican.

To get started is pretty easy and straightforward. On a Debian-based system a simple

$ apt-get install pelican

does the trick. A simple boilerplate can be setup with

$ pelican-quickstart

What that also does is to setup a makefile to assist in developing and uploading the final generated HTML files. Therefore, a simple

$ make publish
$ make rsync_upload

builds the page and uploads via ssh+rsync. Well ... theoretically, after a few very minor steps ...

At first, the default boilerplate has the same template set as for the Pelican homepage. A little bit more personal touch would be nice. Therefore, let us create a custom template.

Start by for example looking at a sample template on one of the numerous free template sites, like for example Keep It Simple. Luckily the themes on that page are licensed under the Creative Commons License and can be used and modified to fit the own style. Just do not forget to give a link to the original theme page, like stated in the license. What we have now is a big example HTML page showing off all the fancy HTML5 and CSS features the designer thought up.

Start by chopping up the page into different sections. The most important is the base.html template. Here the structure of the basic page is set and the content sections are included, depending on which type of page should be rendered. This and all other templates can be obtained by taking the chopped up original template, throwing out all javascript that is not needed and taking the header and footer section together in this file. The page content will be inserted, where the {{page.content}} placeholder will be put. If that all is too much work, then a premade template from the Pelican Github repository can be chosen (as for example the theme of this page is also available on my Github). Just put it in the themes subdirectory and configure the name of the theme in the main pelicanconf.py file.

Content can be generated by putting one reStructured text file per page in the content folder. If the corresponding configuration option is set, then each subdirectory in the content folder will be a category and all the pages therein will be placed in that subcategory.