2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2026-04-01 11:34:10 +01:00

formatting and defaults done

This commit is contained in:
2025-01-15 18:48:23 +00:00
parent 21d69994e7
commit f3bd9024cf
3 changed files with 59 additions and 40 deletions

View File

@@ -122,12 +122,15 @@ def make_new_expo(year):
u.save()
def make_new_expo_dir(year):
t = "<a href='index.html'>index</a><br><a href='mission.html'>mission</a><br><a href='logbook.html'>logbook</a><br>"
pages = ["index", "logbook", "mission", "travel"]
t = "<hr />"
for ff in pages:
t += f"<a href='{ff}.html'>{ff}</a><br>\n"
year_dir = Path(settings.EXPOWEB, 'years', year)
if not year_dir.is_dir():
year_dir.mkdir(parents=True, exist_ok=True)
for ff in ["index","logbook", "mission"]:
content = f"<html><head><title>{ff}</title></head><body><h1>{ff}</h1>{t}</body></html>"
for ff in pages:
content = f"<html><head><title>{year} {ff}</title></head><body><h1>{ff}</h1>Add content here.{t}</body></html>"
p = Path(year_dir, ff+".html")
if not p.is_file():
write_and_commit( [(p, content, "utf8")], f"Auto new year {ff} file creation", "Auto New Year <make_new_expo_dir@troggle.expo>")