Skip to content

Instantly share code, notes, and snippets.

@zunction
Forked from JosefJezek/how-to-use-pelican.md
Created January 19, 2016 05:32
Show Gist options
  • Save zunction/199f788bb56985c88c7b to your computer and use it in GitHub Desktop.
Save zunction/199f788bb56985c88c7b to your computer and use it in GitHub Desktop.
How to use Pelican on GitHub Pages

How to Pelican

Install on Ubuntu

Installing Python tools

sudo easy_install pip
sudo pip install virtualenv
sudo pip install virtualenvwrapper

vi ~/.bashrc
# Virtualenvwrapper
export WORKON_HOME=$HOME/.virtualenvs
source /usr/local/bin/virtualenvwrapper.sh

source ~/.bashrc
mkvirtualenv blog
workon blog

# And to leave:
deactivate

Installing Pelican

sudo pip install pelican
sudo pip install markdown

Creating a blog on GitHub Pages

Steps to publish a post

In parenthesis is the git branch we are working on:

  • (master) Create the post in rst or md (rst and md are abbreviations for resTructuredText and markdown)
  • (master) Generate the HTML
  • (master) Check the post in a local server
  • (master) We could delete the output but dones't matter if we don't because git will ignore with our gitignore file
  • (gh-pages) Merge master branch
  • (gh-pages) Generate the HTML
  • (gh-pages) push all the files (normally all the new HTML)
  • (master) push all the files (normally only one post)

Resources

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment