This repository contains the code and data of the VerCors website. It is generated as a set of static pages.
The website is built by build.py
. To pull in the dependencies, e.g. set up a virtualenv:
$ virtualenv venv -p python3
$ source venv/bin/activate
$ pip3 install -r requirements.txt
Then build the website:
$ python3 build.py
You can also run a debug version of the website to inspect your edits, though it does not automatically update on save:
$ python3 test.py
Building the website...
Now serving on http://localhost:8000/
/build
contains the statically rendered website after building;/generated_templates
contains generated jinja templates after building;/data
contains the website data structured as toml;/templates
contains html templates rendered with jinja2;/static
contains other resources, and is copied as is.
Generally the process of building is as follows:
urls
is loaded from/data/urls.toml
data
is constructed by loading the other files in/data
pages
couples entries inurls
to template files/build
and/generated_templates
are deleted- The templates for the wiki and wiki menu are rendered into
/generated_templates
- Everything in
pages
is rendered withdata
as context, plus any additional arguments frompages
- If the URL ends in
/
,index.html
is appended automatically
- If the URL ends in
/static/**/*
is copied to/build
- Make a new entry in
/data/urls.toml
- Make a new entry in
build.build.pages
- If need be, load more data into
data
if you want a separate toml file in/data