-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.py
34 lines (28 loc) · 897 Bytes
/
build.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
"""Main script to build the website from jinja templates."""
from jinja2 import Environment, FileSystemLoader, select_autoescape
env = Environment(
loader=FileSystemLoader(searchpath="./templates/"), autoescape=select_autoescape()
)
if __name__ == "__main__":
# pages to build
pages = [
"index.html",
"supported-devices.html",
"faq.html",
"download.html",
"imprint.html",
"privacy.html",
"feedback.html",
"404.html",
]
# Load template files and write the rendered HTML
for page in pages:
# render the templates
template = env.get_template(page)
output = template.render(
version="v0.5.4-beta.1-fixup",
n_supported_devices=88,
)
# write to file
with open(f"public/{page}", "w") as html_output:
html_output.write(output)