Creating this Blog

Recently a friend of mine asked me how I configured my system so that slock locks the screen when I close the lid.

Since I couldn't remember how I did it, I thought it's time to create a blog where I can write down stuff like this.

The same friend recommended me to use pelican to create my blog.

Setting up pelican

Setting up pelican is quite straight forward. First I created a new developement environment with virtualenv.

$ virtualenv blogenv
$ cd blogenv
$ . bin/acivate

Then installing pelican

$ pip install pelican

The next step is to create the base structure with the interactive pelican-quickstart

$ mkdir blog; cd blog
$ pelican-quickstart
$ ls
content/    output/*  Makefile

Thats it! Your pelican installation is finished! To generate your still empty blog is easy

$ make html
$ make devserver

After that you can preview you blog on http://localhost:8000

Integrating with github pages

Since I don't own any webspace I wanted to use the pages feature of github

I created two repositories

  • username/, where I host the pelican sources
  • username/, where I host the generated output

Pelican supports this approach as seen in

So all you need to do is to install ghp-import

% pip install ghp-import

Then change SITEURL in to and edit the github target in the Makefile to look like this

github: publish
  ghp-import $(OUTPUTDIR)
  git push gh-pages:master

ghp-import will create a branch in the current git repository called gh-pages and commit any changes in the output directory to it. Then we push this branch to the master branch in our repository.

So if you type

$ make github

The blog gets published under