Changing the Pelican theme to Flex

Posted on Thu 30 September 2021 in Blogging • Tagged with Pelican, GitHub pages, Blog

In a previous post I explained how to use Pelican with GitHub pages but didn't explain how to change the theme. I've changed it now to use Flex and it was harder than expected.

Most of the guides I've found talked about cloning pelican-themes in a folder on your system and changing the variable THEME to that folder. However, that doesn't work when you are using GitHub actions to build your site because it won't find that folder.

My solution was cloning the theme I wanted, Flex, to a folder inside the root folder of the blog:

git clone https://github.com/alexandrevicenzi/Flex

Then I set in pelicanconf.py the variable THEME as follows:

THEME = 'Flex'

In order to make it work with GitHub actions, I had to add in the file publi.sh, before calling pelican, this line:

git clone https://github.com/alexandrevicenzi/Flex

After commiting and pushing, it worked.


Using Pelican as blogging platform for GitHub

Posted on Tue 28 September 2021 in Blogging • Tagged with Pelican, GitHub pages, Blog

So I guess my first blog should be about setting up this blog.

I wanted to use GitHub pages. By default they use Jekyll, which is built with Ruby. I have no experience with that language, so I tried to use something Python-based. I found this post about using Pelican, but I had some problems. I'm going to try to give here step by step instructions, using Linux.

Create a directory for the blog, an environment and activate it:

mkdir blog
cd blog
python -m venv .venv
source .venv/bin/activate

Install pelican with one of these options:

# This option only allows reStructuredText
python -m pip install pelican

# This allows markdown and reStructuredText
python -m pip install "pelican[markdown]"

Create the basic structure:

pelican-quickstart

I'll leave the standard theme. Read in the mentioned post if you want to change the theme.

Note I've created a new post about how to change the style to Flex

To test locally the blog, generate the site with:

make html

Now start a web server with:

make serve

You …


Continue reading