How to make a blog like this

Marton Trencseni - Thu 07 January 2016 - Meta

Getting your own blog like this is really easy, no server hosting nedded. There are two ingredients:

  • Github Pages
  • the Pelican static blog generator

Github Pages

Suppose your username on github is mtrencseni. Create a repo called Here's mine: Anything you put in there will be served up at Try it out for youself, put in an index.html containing Hello world.

Your own domain name with Github Pages

I wanted to use my existing domain name Github is so nice, they support this. Put a file called CNAME into your repo. Here's mine:

This tells Github to expect requests for this domain. What's left is to tell your DNS provider to use Github. (My registrar is, so much better than Godaddy.) Create an A record that points to, this is a Github IP address. That's it. For it looks like this:

$ dig

; <<>> DiG 9.9.5-3ubuntu0.5-Ubuntu <<>>
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 34353
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

; EDNS: version: 0, flags:; udp: 512
;                  IN      A

;; ANSWER SECTION:           600     IN      A

;; Query time: 19 msec
;; WHEN: Thu Jan 07 21:36:09 UTC 2016
;; MSG SIZE  rcvd: 57

Generating a static blog

Github will serve static content from your repo, it doesn't run any scripts. So you need to use a static site generator and serve up the generated pages. Fortunately, there are many. The two biggest ones are Jekyll for Rubyists and Pelican for Pythonistas. I'm a Python guy, so I use Pelican. The Pelican quickstart doc explains how to generate an empty blog. Basically:

$ pip install pelican markdown
$ cd blog
### this is locally
$ pelican-quickstart
$ vi contents/
### see the docs what an article should look like
$ pelican content
### generates static files in the `output` dir
$ cp -R ouput/* ../
$ cd ../
$ git add * && git commit -m "Working :)" && git push
### it's live!

Simply copy the contents of Pelican's output directory into, and that's it.

Getting a theme for Pelican

The default theme is kind of crappy looking. Fortunately, there's a ton of free themes for Pelican at Here's the github repo for all those themes: I picked Flex, and did some very minor customization on it. Getting Pelican to use a theme is simple: put a line like THEME = 'flex' into your, where flex is the directory containing the theme you picked. Here is mine:

Putting it all together

I have a repo which contains the source of the blog. It's a copy of Pelican, with my articles in the content directory, and a (customized) copy of the flex theme in the flex directory.

I use Pelican to generate the static output, and then that gets pushed to

I customized the Makefile to automate this. Here's mine: It contains targets for clean, output, preview and publish. preview uses the built in Python webserver to serve up the static site on localhost:8080 for testing. publish git commits to the repo.

That's it. You can get up an running within a day.