Simple steps to a personal blog
This personal blog is constructed on the following components:
Some more details could be found in the homepage of the aforementioned projects. The following parts provides an initial setup for static personal webpages.
Why Pelican ?
Well, there are certainly many other excellent choices like Jekyll. While for someone with a heavy reliance on Python, Pelican constitutes a better tool.
Software Setup
Before starting, one needs to install Pelican, Markdown and one Markdown Editor. One easiest way to install is using the "pip" command:
pip install pelican
pip install Markdown
There are some other tools that are optional but quite useful, such as Pandoc, which provide powerful support for a wide range of markup format. Another usefull tool could be IPython.
As to the Markdown editor, for MAC users, the best choice is Mou; and for Windows uders, MarkdownPad is perhaps the most siutable one.
After installation, some configurations are needed to make the writing more confortable, including installing some useful plugins and choosing a suitable theme. Those steps will be shown below.
Simple Steps
To start, make one working directory for the blog, and generate the fundamental structures with Pelican Quick Start:
mkdir blog
cd blog
pelican-quickstart
Now a series of files and folders are generated. Download the Pelican Theme from the official repository and put the decompressed folder in the working directory (here, the "/blog" directory). Check the avilable themes through:
pelican-theme --list
Choose one theme in the list (like "bootstrap"), run:
pelican-theme --install ~/path/to/pelican-themes/bootstrap --verbose
Now download the offical plugins and decompress into the working directory. In this blog, we rely on a plugin called liquid_tags. Open the configuration file pelicanconf.py and add the following lines:
In many cases, the chosen theme is not perfect enough and required to be modified. Here in order to work with IPython notebook, we need to some changes in the base.html file. The following code are added within the header tag:
{% if EXTRA_HEADER %}
{{ EXTRA_HEADER }}
{% endif %}
Clearly, the above code is used to integrate the _nb_header.html (generated by IPython notebook) into the theme. More details could be found at Jake Vanderplas's blog .
Now set up a repository on Github with the name username.github.io . Clone this repository in the "output" directory:
cd output
git clone https://github.com/username/username.github.io.git
Write your articles in the "content" directory with the Markdown editor. Go back to the main working directory and prepare to publish them:
pelican -s pelicanconf.py ./content -o ./output/username.github.io
The final steps would be add/commit/push all files to Github:
cd output/username.github.io
git status
git add --all
git commit -am "Your Commit Message"
git push https://github.com/username/username.github.io.git
The last step could be changed if Git has been configured properly:
git push origin master
Open https://username.github.io in your browser, and your personal blog will be shown.