mirror of
https://github.com/rjNemo/vf-site
synced 2026-06-06 01:16:38 +00:00
22 lines
530 B
Python
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))
|