Skip to content

How to build the class website locally

Sebastian Benthall edited this page Sep 20, 2013 · 1 revision

These instructions are under development.

This guide takes you through the steps you need to build and test the course website locally.

Our site is made with Pelican, a Python static-site generator.

If you are familiar with Python development, you are probably familiar with virtualenv, a tool for creating isolated Python environments. In this guide we will use virtualenv. Please install it now, or proceed without it at your own risk.

  1. Make a directory to work in, and go into it

    mkdir i290m-test

    cd i290m

  2. Make a virtualenv there. This will create a Python environment where you can install things without interacting with the Python packages you have installed globally on your machine

    virtualenv venv

  3. Activate the virtualenv. This will change the Python instance you are using, and make it so any libraries you install are installed to the local instance

    source venv/bin/activate

  4. Clone the course site. Use the URL of your own fork if you are intending to push changes back upstream.

    git clone https://github.com/sbenthall/i290m-ocpp-site.git

  5. Install Pelican and Markdown

    pip install pelican

    pip install Markdown

  6. Clone the site theme and make sure Pelican knows about it

    git clone https://github.com/sbenthall/dissertron-theme.git

    pelican-themes -i dissertron-theme/

  7. Go into the site directory, publish the content to HTML, and serve the files locally

    cd i290m-ocpp-site/

    make publish

    make serve

  8. Explore the website, which should be at localhost:8000

  9. You can use Ctrl-D to interrupt the server and regain control of your terminal. Or you can open another terminal to make changes to content and run make publish. You should immediately be able to see the changes by refreshing your browser.

Clone this wiki locally