Change the visual theme of your Pelican blog

sam. 10 juin 2017 by Mick Cherry

The Pelican default theme is notmyidea-cms, but there are dozens of themes you can freely use.

Here is how I did it.

In a random folder, get all the Pelican themes

$ cd random_folder
$ git clone --recursive https://github.com/getpelican/pelican-themes

You can see all the themes names (which are actually git submodules inside the pelican-themes repository):

$ cd random_folder
$ ll pelican-themes/
total 508
drwxrwxr-x 123 etienne etienne 4096 juin  10 14:03 ./
drwxrwxr-x   4 etienne etienne 4096 juin  10 14:00 ../
drwxrwxr-x   4 etienne etienne 4096 juin  10 14:03 aboutwilson/
drwxrwxr-x   3 etienne etienne 4096 juin  10 14:12 alchemy/
drwxrwxr-x   5 etienne etienne 4096 juin  10 14:12 apricot/
drwxrwxr-x   4 etienne etienne 4096 juin  10 14:12 attila/
drwxrwxr-x   4 etienne etienne 4096 juin  10 14:03 backdrop/
drwxrwxr-x   4 etienne etienne 4096 juin  10 14:03 basic/
drwxrwxr-x   5 etienne etienne 4096 juin  10 14:12 bluegrasshopper/
drwxrwxr-x   4 etienne etienne 4096 juin  10 14:12 blueidea/
drwxrwxr-x   4 etienne etienne 4096 juin  10 14:12 blue-penguin/
drwxrwxr-x   4 etienne etienne 4096 juin  10 14:12 bold/
drwxrwxr-x   4 etienne etienne 4096 juin  10 14:03 bootlex/
drwxrwxr-x   4 etienne etienne 4096 juin  10 14:03 bootstrap/
drwxrwxr-x   4 etienne etienne 4096 juin  10 14:03 bootstrap2/
drwxrwxr-x   4 etienne etienne 4096 juin  10 14:03 bootstrap2-dark/
drwxrwxr-x   4 etienne etienne 4096 juin  10 14:03 bricabrac/
...

Create (if it does not already exists) the themes/ folder in your blog main folder.

$ cd blog
$ mkdir themes

Copy the folder of your chosen theme (in this case, blueidea) inside the newly created themes/ folder

$ cd random_folder
$ cp -r pelican-themes/blueidea blog/themes

Update the blog configuration file with the THEME variable

$ echo "THEME='themes/blueidea'" >> pelicanconf.py

You're done! Check the theme change by launching

$ cd blog
$ make github

And going to your Github Pages url.