NOTE: this repo is no longer in use. OpenByLaws.org.za is now powered by Laws.Africa's Open Law Technology
This repo is the openbylaws.org.za website, based on Jekyll. There are two major steps to building this website:
bin/update.py
is a Python script which pulls by-law information from Laws.Africa and sets up the appropriate Jekyll site structure.jekyll build
builds the website as a regular Jekyll website.
In production, these two steps are performed by Travis-CI, and the resulting site is force pushed to the gh-pages
branch as a static website.
This repo looks a bit empty, there are no places and by-laws. This saves us from having a repo tracking every change to every by-law. Instead, this repo is fleshed out by Travis-CI during the build phase.
- Clone this repo
- Tell git to fetch only the master branch, and not the
gh-pages
branch, which is built automatically and is very big. Edit.git/config
and change thefetch
line of the[remote "origin"]
section to look like this:fetch = +refs/heads/master:refs/remotes/origin/master
- Install Python dependencies:
pip install -r requirements.txt
- Install Jekyll:
bundle install
- Get your Laws.Africa API token from edit.laws.africa/accounts/profile/api/
export INDIGO_API_AUTH_TOKEN=your-token
- Pull in by-law content for just one region:
bin/update.py --quick za-cpt
- Build the website:
bundle exec jekyll server --watch --incremental
- Add the municipality name, code and by-laws website URL to
_data/places.json
- Add the municipality logo and placard images to
img/municipalities/
, using the naming format<code>-logo.png
and<code>-placard.jpg
. Note that the two files have different extensions. - Push to master