Source of the Open Firenet website, served by GitHub Pages at https://openfirenet.github.io.
- Page contents are in
src/<page>.html; the common header, navigation and footer are insrc/layout.html. - The style is in
assets/style.css, the images inassets/img/. - After a change, run
python3 build.py(Python standard library only) and commit both the source and the generated pages at the root.python3 build.py --checktells whether the generated pages are up to date. - The API reference page is generated from
src/openapi.json, a copy of the firmware'sopenapi.yaml. After a change of the API, refresh it withpython3 build.py --sync ../open-firenet/openapi.yaml(needs PyYAML) and commit the result. - The site is in English, French, German, Italian and Spanish. English pages are at the root, built from
src/<page>.html; each other language is in its own folder (fr/,de/,it/,es/), built fromsrc/<code>/<page>.html. The texts of the header, menu and footer are inTEXTSinbuild.py. - Each translation starts with a
<!-- source: ... -->line, the fingerprint of the English page it was translated from. When an English page changes,build.pynames the translations that are now out of date: bring them in line, then runpython3 build.py --stamp src/fr/<page>.html. - The API reference is translated through
src/<code>/openapi-strings.json, which maps each text of the API description to its translation; resource paths, field names, types and values are not translated.build.pykeeps that file in step withsrc/openapi.json: a new or changed text is added with an empty translation, which--checkreports, and a text the description no longer has is dropped. - To add a language: add its code to
LANGS, its texts toTEXTSinbuild.pyand toLABELSinapiref.py, translate every page listed inTRANSLATEDintosrc/<code>/, stamp them, runbuild.pyand fillsrc/<code>/openapi-strings.json. - To add a page: create
src/<name>.htmlstarting with the two comment lines (title,description) and add it toPAGESinbuild.py, toNAVif it must appear in the navigation bar, and toTRANSLATEDwith its translations.
Preview locally with python3 -m http.server and open http://localhost:8000.
GitHub Pages serves the files as they are (.nojekyll): nothing is built on GitHub's side.