Skip to content

Generate the NIDM Website

Camille Maumet edited this page Aug 7, 2018 · 9 revisions

Overview

The NIDM Website uses Pelican, a static site generator, to manage blog posts and specification documents. This document provides a tutorial for updating the Website.

Dependencies

# python libraries
pip install pelican
pip install markdown
pip install "jinja2>=2.10"
pip install "fabric>=2.1.3"
pip install ghp-import
pip install python-gettext

# plugins from github
cd doc
git clone https://github.com/getpelican/pelican-plugins.git pelican-plugins

# themes from github
cd doc
git clone https://github.com/getpelican/pelican-themes.git
cd pelican-themes
git submodule update --recursive
cd ../..

# install pelican-bootstrap3 theme
pelican-themes -i /path/to/pelican-themes/pelican-bootstrap3

Build the static site

  • The NIDM site source code is located in the "source" branch of the nidm repo
  • We use fabric to build the site, which is like make
  • fabfile.py shows all the commands that are run
  • The generated site is automatically imported into the gh-pages branch using fab publish
  • For local development you can use fab serve, which will generate the site and open localhost in a browser
cd /path/to/nidm
git checkout master
cd doc

and then

fab -H 127.0.0.1 serve
# check if everything is as expected
fab -H 127.0.0.1 publish

# go check nidm.nidash.org

When using a conda environment, you will have to specify the full path to pelican and to ghp-import:

fab -H 127.0.0.1 serve --fpp=/PATH_TO_PELICAN/
fab -H 127.0.0.1 publish --fpp=/PATH_TO_PELICAN/ --ghpp=/PATH_TO_GHP_IMPORT/

where PATH_TO_PELICAN is the full path to the pelican command (without pelican at the end) and PATH_TO_GHP_IMPORT is the full path to the ghp-import command (without ghp-import at the end).

Folder structure

  • Static pages are located in ./content/pages
  • specs and images are automatically checked out from the master branch and moved over to ./content/specs