Deploying portfolio website using Pelican and Github Pages, Under 10 minutes.
Tue 19 August 2025
Contents
This article provides a step-by-step walkthrough on how to deploy a personal portfolio website using the Pelican, a static site generator and GitHub Pages.
If you’re an expert in your niche and want to start a blog, using a static site generator is a highly efficient method. A static site generator generates all webpages beforehand, and hence you do not need to generate these pages dynamically. We will cover how to build your site the old-school way, giving you full control over your content and platform.
Roadmap
Since, I work in python, I chose to go with Pelican to build my website. Pelican is a static site generator written in Python. It lets you write your content in Markdown or reStructuredText, then generates a fast, lightweight HTML website. Furthermore, we will use github which will provide:
- Storing source code of our website.
- Github actions to automatically build and deploy website.
- Publishing our website for free.
- Easy comment section support using github discussions tab.
To get started, you’ll need two main prerequisites, which many people already have: a GitHub account and Python installed on your system.
Installing Pelican
Create a GitHub Repository for Hosting
- Logged into GitHub and create a new repository.
- Name it:
username.github.io. Replaceusernamewith your GitHub username.
Set Up Pelican Locally
Cloned the repository into the local system
1 2 3 4 | |
Install Pelican
We will install Pelican in our virtual environment portfolio using conda.
1 2 3 | |
Create Website using Pelican Stemplate
After pelican is installed we will create a structure of the project via the pelican-quickstart command, which begins by asking some questions about your site. The below code shows example I followed for my own website setup.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | |
Create a sample article and generate site
We cannot run Pelican until we have created some content. Create an example article as shown below in Markdown format and save it in content/keyboard-review.md.
1 2 3 4 5 | |
From the project root directory, run this pelican command to generate the site:
1 2 | |
Your site is now generated inside the output/ directory. To preview the site we can run the following command.
1 | |
This command generates a local web address. Navigate to http://localhost:8000/ in your browser to see a preview of your website. Right now, pelican is using the default theme “notmyidea”, but we’ll be customizing this theme soon.
Adding Content
In Pelican, there are two primary content types:
- Articles are used for chronological content like blog posts, whereas
- Pages are used for static content such as an ‘About’ or ‘Contact’ page.
We will make separate directories to store them inside the content folder as shown below:
1 2 3 4 5 6 7 8 9 | |
We also added an images folder to store all images that will be used in our content.
Adding and Configuring a New Theme
Pelican has many themes and there is a community-managed repository Github of Pelican Themes for people to share and use. I chose Flex for its clean and responsive design.
Download the Theme
Let’s clone the theme repository to themes/Flex directory.
1 | |
Update Your Configuration
Open your pelicanconf.py file and set the new theme and output directory. The output directory is changed since github only supports serving website using docs directory.
1 2 | |
Now generate the site again and see the new theme will be applied.
1 | |
Customize the theme
The theme can be customized by editing the templates and stylesheet present inside the theme folder (/theme/Flex). Before doing any customization, setup pelican to autoreload the website. This allows us to quickly see results of our changes:
1 | |
Here are the list of changes which I have done in pelicanconf.py
- To add a profile picture, add:
SITELOGO= '/images/avatar.jpg' - Social widgets can also be added via:
SOCIAL = ("github", "<https://github.com/saurabheights>") - Update your name to appear on the left sidebar, add:
SITETITLE= 'Saurabh Khanduja'
We can adjust font size, colors etc in the theme’s folder style.min.css
Commit & Push changes to github
All our changes are currently saved locally. To sync them with GitHub and update the remote repository, use the following commands:
1 2 3 | |
This will not add Flex Theme to our github repository and hence we will need to download it again when rebuilding our website.
Enable GitHub Pages
- Go to your GitHub repo’s Settings → Pages.
- Select the main branch and
docs/folder. - Save the settings, and your site will be live at:
https://$USERNAME.github.io
Conclusion/ End result
So now we have a basic structure of blogging website. In follow up blogs, we will add a few other features such as Comment section, Latex Support to easily render equations, and more.