Added devision by semester
This commit is contained in:
11
src/build.py
11
src/build.py
@@ -19,7 +19,7 @@ def build(trigger_list: list[str] | None = None):
|
||||
# Clear output directory
|
||||
shutil.rmtree(settings.paths.output, ignore_errors=True)
|
||||
shutil.copytree(settings.paths.static, settings.paths.output)
|
||||
inv: list[CSItem] = prepare_cheatsheets(inv_raw, settings.paths.output)
|
||||
inv, cats, no_cat = prepare_cheatsheets(inv_raw)
|
||||
|
||||
if not os.path.exists(settings.paths.prod):
|
||||
os.mkdir(settings.paths.prod)
|
||||
@@ -38,8 +38,15 @@ def build(trigger_list: list[str] | None = None):
|
||||
|
||||
thisYear = datetime.datetime.now().year
|
||||
|
||||
print(cats)
|
||||
|
||||
with open(f"{settings.paths.output}/index.html", "w", encoding="utf-8") as f:
|
||||
f.write(index.render(items=inv, thisYear=thisYear))
|
||||
f.write(index.render(cats=list(
|
||||
sorted(
|
||||
map(lambda c: (c[0], list(c[1].items())), cats.items()),
|
||||
key=lambda x: x[0]
|
||||
)
|
||||
), no_cat=no_cat, thisYear=thisYear))
|
||||
|
||||
with open(f"{settings.paths.output}/impressum.html", "w", encoding="utf-8") as f:
|
||||
f.write(env.get_template("impressum.html.j2").render(thisYear=thisYear))
|
||||
|
||||
Reference in New Issue
Block a user