News and Blog

EPSRC CDT in Next Generation Computational Modelling

How to create posts for the NGCM Blog

Screenshot of Sublime text editor being used to edit the source file for this blog post and a terminal

This post follows after a seminar by Dr Hans Fangohr covering the usage of pelican and ReStructuredText to edit and create posts on the NGCM Blog. This post covers how to install pelican and set things up in OS X so that you can add posts to the NGCM blog.

First you need to install pelican, this can be done with the command pip install pelican.

Next it is nessesary to fork the ngcm-blog repository on github; this is so that you can send pull requests to the master ngcm blog git repository. This is done by simply going onto the ngcm blog repository on github linked here and clicking on the fork button at the top right hand side of the screen.

Next navigate to a directory in which to create the ngcm-blog folder which will contain a clone of this repository. In order to clone the repository you have just forked use the following command; git clone git@github.com:<github_username>/blog.git ngcm-blog and replace <github_username> with your github username, for example I used git clone git@github.com:ajs3g11/blog.git ngcm-blog. This creates a folder in your current directory called "ngcm-blog" and populates it with the contents of the git repository you have just cloned.

If you encounter the following: Error: Permission denied (publickey) then you will need to generate an SSH key for your computer and add it to github in order to clone the NGCM blog directory. I followed this tutorial in order to achieve this.

Now if you cd into this directory and type make html it should use the content in ngcm-blog/pelican/content to create the output in ngcm-blog/pelican/output. Opening the index.html file in the output folder with the command open index.html will open a local version of the webpage. New content and blog posts can be created in the content subfolders, for example blog posts about seminars can be created in the seminars subfolder. Reusing the make html command will apply your changes and re-opening index.html will allow you to view your changes.

Comments