Load templates in prep.py instead of old pages

This commit is contained in:
Txrpe 2024-12-08 20:00:36 +01:00
parent d561b0107d
commit 7df0b58366
3 changed files with 21 additions and 2 deletions

View File

@ -141,7 +141,7 @@ for key, value_pair in TYPES_DICT.items():
# Build Serbian Events page # Build Serbian Events page
new_events_html = build_html(new_events, DAYS_SR, sr_types) new_events_html = build_html(new_events, DAYS_SR, sr_types)
with open("pages/sr/events.html", "r") as file: with open("template/events-sr.html", "r") as file:
page_template = ([line for line in file]) 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:
@ -149,7 +149,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, en_types) new_events_html = build_html(new_events, DAYS_EN, en_types)
with open("pages/en/events.html", "r") as file: with open("template/events-en.html", "r") as file:
page_template = ([line for line in file]) 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:

8
template/events-en.html Normal file
View File

@ -0,0 +1,8 @@
<h1>Events</h1>
<p>
Following list contains all forthcoming events. Held events are listed in
<a href="/en/events_archive">archive</a>.
</p>
<br />
<p>We also provide <a href="https://dmz.rs/events.ical">ical file</a></p>
<br />

11
template/events-sr.html Normal file
View File

@ -0,0 +1,11 @@
<h1>Događaji</h1>
<p>
Naredna lista sadrži sve predstojeće događaje. Za listu održanih događaja
pogledaj <a href="/events_archive">arhivu</a>.
</p>
<br />
<p>
Događaje možeš učitati i sa
<a href="https://dmz.rs/events.ical">ical</a> datotekom.
</p>
<br />