vf-site/main.py
2023-05-28 10:41:08 +02:00

22 lines
530 B
Python

from os import path
from jinja2 import Environment, FileSystemLoader, select_autoescape
engine = Environment(
loader=FileSystemLoader("templates"),
autoescape=select_autoescape(),
)
def render(template: str) -> str:
return engine.get_template(template).render()
# TODO: from a config
templates = ["index.html", "t2-corail.html", "t3-azur.html", "contact.html"]
for template in templates:
print(f"render '{template}'")
with open(path.join("dist", template), "w") as f:
f.write(render(template))