-
Notifications
You must be signed in to change notification settings - Fork 28
How to build the class website locally
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.
-
Make a directory to work in, and go into it
mkdir i290m-test
cd i290m
-
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
-
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
-
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
-
Install Pelican and Markdown
pip install pelican
pip install Markdown
-
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/
-
Go into the site directory, publish the content to HTML, and serve the files locally
cd i290m-ocpp-site/
make publish
make serve
-
Explore the website, which should be at localhost:8000
-
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.