Host Pelican on Github Pages

Creating a blog can be easy, you can either choose a blog system then host yourself or using public blog hosting provider like WordPress.com, Google Blogger and many other providers. If you like having flexibility and love playing with different technologies, a self-hosting blog might be your best choice. You can choice whatever technology you like and build a customized blog on it. If simplicity is your thing, then public blog provider is your first choice, all you need to worry about is what to write.

Other than the first two categories, there is a third option. You will have the ability to customize your blog while the deployment process is still relatively simple. The static blog generator provides a good balance between flexibility and simplicity. There are many static blogs you can choice from. Check out the top popular static site generators ranked by StaticGen.

Today what I am going to talk about is Pelican which is what beneath the blog you are reading. According to Pelican Offical Website

Pelican is a static site generator, written in Python, that requires no database or server-side logic.

How to setup Pelican

Install pip

Download get-pip script from get-pip.py or run command in shell curl -O https://bootstrap.pypa.io/get-pip.py. After you have the script locally, run command python get-pip.py

Upgrade

If you already have pip installed and want to upgrade. On Linux or OS X: pip install -U pip On Windows: python -m pip install -U pip

Install virtualenv

virtualenv is a tool to create isolated Python environments.

To install virtualenv and virtualenvwrapper, run pip install virtualenvwrapper, this command will install wirtualenvwrapper and all its dependencies.

Set up virtualenv with virtualenvwrapper

Once you have virtualenvwrapper installed, there are few more little things need be setup.

Simply add the lines below to your shell startup file (.bashrc, .profile, etc.)

export WORKON_HOME=$HOME/.virtualenvs
export PROJECT_HOME=$HOME/Devel
source /usr/local/bin/virtualenvwrapper.sh

After updating the shell startup file, run command source .bashrc or source .profile, this will load the new version of shell startup file. You can also reopen a terminal to pickup the changes.

How to use virtualenvwrapper?

Install Pelican

Before install pelican, make sure you have pip and virtualenvwarpper installed and setup.

mkdir -p ~/projects/yoursite
cd ~/projects/yoursite

Github Pages

After setup my pelican on my local machine, I started to wonder where should I host my pelican blog? I found that the easiest way to host pelican is via Github Pages.

There are two kinds of Github Pages user site and project site. The process of setting up both kinds of Github Pages are very similar.

git add --all
git commit -m "Initial commit"
git push -u origin master

Links

Tags

Comments

comments powered by Disqus