generate event page in prep from the whole page

This commit is contained in:
fram3d 2024-02-08 18:01:43 +01:00
parent 4959a91b08
commit bd496eac3c
Signed by: fram3d
GPG Key ID: 938920E709EEA32A

View File

@ -91,7 +91,7 @@ page_template = ""
# Build Serbian Events page # Build Serbian Events page
new_events_html = build_html(new_events, DAYS_SR) new_events_html = build_html(new_events, DAYS_SR)
with open("pages/sr/events.html", "r") as file: with open("pages/sr/events.html", "r") as file:
page_template = ([line for line in file])[:2] page_template = ([line for line in file])
with open("pages/sr/events.html", "w") as file: with open("pages/sr/events.html", "w") as file:
file.writelines(page_template + new_events_html) file.writelines(page_template + new_events_html)
@ -99,7 +99,7 @@ with open("pages/sr/events.html", "w") as file:
# Build English Events page # Build English Events page
new_events_html = build_html(new_events, DAYS_EN) new_events_html = build_html(new_events, DAYS_EN)
with open("pages/en/events.html", "r") as file: with open("pages/en/events.html", "r") as file:
page_template = ([line for line in file])[:2] page_template = ([line for line in file])
with open("pages/en/events.html", "w") as file: with open("pages/en/events.html", "w") as file:
file.writelines(page_template + new_events_html) file.writelines(page_template + new_events_html)
@ -107,7 +107,7 @@ with open("pages/en/events.html", "w") as file:
# Build Serbian Archive page # Build Serbian Archive page
past_events_html = build_html(past_events, DAYS_SR) past_events_html = build_html(past_events, DAYS_SR)
with open("pages/sr/events_archive.html", "r") as file: with open("pages/sr/events_archive.html", "r") as file:
page_template = ([line for line in file])[:2] page_template = ([line for line in file])
with open("pages/sr/events_archive.html", "w") as file: with open("pages/sr/events_archive.html", "w") as file:
file.writelines(page_template + past_events_html) file.writelines(page_template + past_events_html)
@ -115,7 +115,7 @@ with open("pages/sr/events_archive.html", "w") as file:
# Build English Archive page # Build English Archive page
past_events_html = build_html(past_events, DAYS_EN) past_events_html = build_html(past_events, DAYS_EN)
with open("pages/en/events_archive.html", "r") as file: with open("pages/en/events_archive.html", "r") as file:
page_template = ([line for line in file])[:2] page_template = ([line for line in file])
with open("pages/en/events_archive.html", "w") as file: with open("pages/en/events_archive.html", "w") as file:
file.writelines(page_template + past_events_html) file.writelines(page_template + past_events_html)