Pelican is an exclusive static site generator based on Python 3. It uses pip package manager to work on a Linux machine. Pelican uses Jinja2 templates to build static websites. I am going to help you how to install, get comfortable, and remove Pelican from your computer in this guide. I am using Ubuntu 20.04 LTS for the guide.
You will need the following packages installed to keep the Pelican installation process smooth.
- Pelican Markdown
If you do not have these packages installed on your system, then follow the instructions below to install them.
$ sudo apt install python3
$ sudo apt install pip
Pelican needs at least 3.6 versions of Python to begin working. I will install Pelican Markdown along with Pelican.
Step 1. Run Installation On Command Line
python -m pip install "pelican[markdown]"
Once installed, you will get a success message as shown below and you will be good to go then.
Step 2. Create a project
At this stage, I will create a new project for our new website. The process goes like creating a new directory and changing it. Here are the commands:
$ mkdir -p ~/projects/pSite
$ cd ~/projects/pSite
Step 3. Use Pelican Quick Start
I will now use a Pelican quick start that will help me to run a static site in the above folder.
Pelican will ask some questions about the website. Once answered as shown in above screenshot, you will be able to run your website without any issues.
Step 4. Run the websites
At this point, I will create a draft post and publish it to localhost.
Once processed, Pelican will start serving the static pages to localhost, which can be published to any web hosting platform.
Step 5. Generate the Website
Now use the following command to generate the website for the deployment
$ pelican content
Now your static website is available on the following path. You can choose to deploy it anywhere.
Pelican makes it easier to publish static websites. The greatest disadvantage Pelican has is that it does not offer hot reload.
In this guide, I helped you to understand pelican. You installed Pelican using pip on Ubuntu 20.04 LTS. You have also learned how to run and remove Pelican. If you have any questions, you can ask us here without hesitation. We will be delighted to respond.
Karim Buzdar holds a degree in telecommunication engineering and holds several sysadmin certifications including CCNA RS, SCP, and ACE. As an IT engineer and technical author, he writes for various websites.