Fork me on GitHub

How to build a static website using Pelican

It's fairly easy to build a static website. Static websites differ from dynamic in that they do not communicate with a database of any sorts. This makes it easier and especially cheaper to deploy to almost any setup which runs at least rudimentary serving capabilities.

There are many options for static site generation, I chose Pelican. There is no particular adamant reason behind it, but browsing for themes did tilt the scales in its favor.

Workflow is basically simple. One time install is that of Python (e.g. version 3.6). Once you have that, I would recommend you also get pip install virtualenvwrapper.

You then activate virtual environment and install all dependencies for pelican.

# create and activate virtual environment
mkvirtenv mystaticwebsite
workon mystaticwebsite

# installs pelican
pip install pelican

Create your project folder

mkdir mywebsite
cd mywebsite

Now feel free to follow instructions from pelican-quickstart on.

Once you are done writing contents to a markdown (.md) file you 'publish' your website, which puts all the bits and pieces together (applies settings, theme...) into an /output folder. Copy the content of this folder to your hosting service and you're done (I'm ignoring the domain issue here, sorry).

To publish your website and also include settings specified in the publishconf.py, use pelican content --output output --settings publishconf.py.

1995 style links

social