Create a blog using Pelican
Date: February 17th 2018
Last updated: February 17th 2018
I created a blog using "Pelican, which takes great advantage of Python". Heres what I did and heres the site.
References
http://docs.getpelican.com/en/3.6.3/quickstart.html
http://docs.getpelican.com/en/3.6.3/pelican-themes.html
http://docs.getpelican.com/en/3.6.3/tips.html
Setup virtualenv
mkvirtualenv pelican -p python3
Install pelican
pip install pelican
pip install Markdown
pip install typogrify
pip install ghp-import
Create project
cd repos && mkdir blog
pelican-quickstart
Set up git & github repo
Install of Git and setup of Github repo not shown here.
#(pelican) ray:~/repos/blog
git init
git remote add origin https://github.com/rayblick/blog.git
git add .
git commit -m "initial commit"
git push origin master
#username
#pwd
Add an article
# repos/blog/content
nano article1.md
Add content to article
Title: Article One
Date: 2018-02-03 19:08
Modified: 2018-02-03 19:08
Category: test
Tags: blog
Authors: Ray Blick
Summary: Testing out pelican
## Aim
My first article
Add about page (and add content)
cd content/pages
nano about.md
Download Pelican-themes
cd ..
# repos (outside of blog)
git clone --recursive https://github.com/getpelican/pelican-themes pelican-themes
File structure
The pelican-themes folder contains many files so it is ignored in this command and added in as an example.
# ignore pelican-themes folder
tree -I 'pelican-themes'
├── pelican-themes # (added as example)
│
├── blog
│ ├── content
│ │ ├── article1.md
│ │ ├── images
│ │ │ └── img1.jpg
│ │ └── pages
│ │ └── about.md
│ ├── develop_server.sh
│ ├── fabfile.py
│ ├── Makefile
│ ├── output
│ │
│ ├── pelicanconf.py
│ ├── publishconf.py
Modify pelicanconf.py
# --- snipped ---
#Uncomment localhost for development
#SITEURL = 'http://localhost:8000'
SITEURL = 'https://rayblick.github.io/blog'
# Social widget
SOCIAL = (('linkedin', 'https://www.linkedin.com/in/ray-blick-93b359b5'),
('github', 'https://github.com/rayblick'),
('twitter', 'https://twitter.com/Ray_Blick'),
)
# Specify name of a built-in theme
THEME = "../themes/pelican-themes/pelican-blue"
# Theme setup
SIDEBAR_DIGEST = 'my blog'
DISPLAY_PAGES_ON_MENU = True
TWITTER_USERNAME = 'Ray_Blick'
MENUITEMS = (('Blog', SITEURL),('About', SITEURL+'/pages/About.html'),)
STATIC_PATHS = ['images']
Run pelican to create blog pages
cd repos/blog
pelican content
Push to gh-pages
ghp-import output
git push origin gh-pages