fast fertig

This commit is contained in:
florian committed 2026-10-03 13:29:12 +02:00
1 parent d1e833e5db
commit 833f896887
9 files changed
+85 -21

No files matched your search

+33 -9
View File
@@ -265,10 +265,11 @@ def _slugify(s):
return s or "abschnitt"
def heading_nav(headings):
def heading_nav(headings, prefix=""):
"""Baut die Anker-Navigation als verschachtelte ul/li-Liste:
Eine Ueberschrift mit einem # mehr als die vorherige wird als
Unterpunkt eingerueckt.
Unterpunkt eingerueckt. prefix erlaubt Links auf eine andere Seite
(z.B. "index.html" -> href="index.html#anker").
headings: Liste von (level, anker, text).
"""
if not headings:
@@ -290,7 +291,7 @@ def heading_nav(headings):
parts.append("</li></ul>")
levels.pop()
parts.append("</li>")
parts.append('<li><a href="#%s">%s</a>' % (hid, _escape(text)))
parts.append('<li><a href="%s#%s">%s</a>' % (prefix, hid, _escape(text)))
parts.append("</li>")
while len(levels) > 1:
parts.append("</ul></li>")
@@ -354,7 +355,7 @@ def block_html(slug):
return ""
def render_page(raw, template, header_html="", footer_html=""):
def render_page(raw, template, header_html="", footer_html="", start_anker_html=""):
meta, body = parse_md(raw)
headings = []
html = md_to_html(body, headings)
@@ -363,10 +364,14 @@ def render_page(raw, template, header_html="", footer_html=""):
.replace("{{titel}}", _escape(meta.get("titel", "")))
.replace("{{beschreibung}}", _escape(meta.get("beschreibung", "")))
.replace("{{inhalt}}", html))
# {{anker-start}}: Navigation der Startseite, verlinkt auf index.html#anker
if "{{anker-start}}" in template:
page = page.replace("{{anker-start}}", start_anker_html)
if "{{anker}}" in template:
page = page.replace("{{anker}}", anker_html)
elif anker_html and "{{header}}" in template:
# Template ohne {{anker}}-Platzhalter: Anker ans Ende des Headers
elif (anker_html and "{{anker-start}}" not in template
and "{{header}}" in template):
# Template ganz ohne Anker-Platzhalter: eigene Anker ans Header-Ende
page = page.replace("{{header}}",
header_html + '\n<nav class="anker-nav">' + anker_html + "</nav>")
if "{{header}}" in template:
@@ -384,7 +389,17 @@ def render_page(raw, template, header_html="", footer_html=""):
return page, meta.get("titel", "")
def load_template():
def load_template(slug=None):
"""Template fuer eine Seite: templates/<slug>.html wenn vorhanden,
sonst default.html, sonst das erste gefundene Template."""
candidates = []
if slug:
candidates.append(os.path.join(TPL_DIR, slug + ".html"))
candidates.append(os.path.join(TPL_DIR, "default.html"))
for c in candidates:
if os.path.exists(c):
with open(c, encoding="utf-8") as fh:
return fh.read()
files = [f for f in os.listdir(TPL_DIR) if f.endswith(".html")]
if not files:
raise SystemExit("Kein Template in templates/ gefunden (z.B. default.html).")
@@ -394,7 +409,6 @@ def load_template():
def export_site():
"""Baut output/: pro MD-Datei eine HTML-Seite, CSS wird kopiert."""
template = load_template()
# Output leeren und neu aufbauen
if os.path.isdir(OUT_DIR):
shutil.rmtree(OUT_DIR)
@@ -412,9 +426,19 @@ def export_site():
footer_html = block_html(FOOTER_PAGE)
header_html = block_html(HEADER_PAGE)
# Anker-Navigation der Startseite (fuer Templates mit {{anker-start}},
# z.B. impressum: Links auf index.html#anker)
start_headings = []
if os.path.exists(md_path(START_PAGE)):
_, s_body = parse_md(load_page(START_PAGE))
md_to_html(s_body, start_headings)
start_anker = heading_nav(start_headings, prefix="index.html")
exported = []
for slug in list_pages():
page, _ = render_page(load_page(slug), template, header_html, footer_html)
template = load_template(slug)
page, _ = render_page(load_page(slug), template, header_html, footer_html,
start_anker)
# startseite.md wird zur index.html
out_name = "index.html" if slug == START_PAGE else slug + ".html"
with open(os.path.join(OUT_DIR, out_name), "w", encoding="utf-8") as fh:
+9 -1
View File
@@ -93,6 +93,14 @@ main {
color: var(--green);
}
/* Prompt als Link auf die Startseite, ohne Hover-Effekt */
a.prompt-link,
a.prompt-link:hover {
color: var(--green);
text-decoration: none;
text-shadow: none;
}
/* Blinkender Terminal-Cursor hinter dem Prompt */
.cursor {
display: inline-block;
@@ -142,7 +150,7 @@ main div.sec0 {
img {
display: block; /* Text startet immer unter dem Bild */
max-width: 500px; /* Desktop: maximal 500px breit */
max-width: 1200px; /* Desktop: maximal 500px breit */
height: auto;
border: 1px solid #333333; /* dunkelgrauer Rand */
margin: .8rem 0;
+1 -2
View File
@@ -2,5 +2,4 @@
titel: Footer
---
Dieser Footer-Baustein wird automatisch an das Ende **aller** Seiten gesetzt.
Zum Beispiel mit Links: [Startseite](index.html)
[Impressum](impressum.html)
+1 -1
View File
@@ -30,8 +30,8 @@ Alle, die sich für Linux, Open Source und die Förderung von Wissen in Kunst un
Ziel ist es, den Einsatz freier Software in Kunst und Design zu fördern. Durch Workshops, den Aufbau von Wissensdatenbanken, Austausch und Debatten sollen Eigenermächtigung und Verantwortung für Technologie wiederhergestellt werden. Dazu entwickeln wir gemeinsam ein eigenes Linux-basiertes Betriebssystem und unterstützen bei allen Schritten des Wechsels zu freier Software.
# Das hfg_OS_
![hfg_os_background_1_fullhd](images/hfg_os_background_1_fullhd.jpg)
Das hfg_OS ist ein auf Debian 13 (Trixie) basierendes, Linux-basiertes Betriebssystem. Es wurde speziell für die Bedürfnisse von Künstler:innen und Designer:innen angepasst und wird kontinuierlich weiterentwickelt.
![hfg_os_background_1_fullhd](images/hfg_os_background_1_fullhd.jpg)
## Versionen
+9 -1
View File
@@ -93,6 +93,14 @@ main {
color: var(--green);
}
/* Prompt als Link auf die Startseite, ohne Hover-Effekt */
a.prompt-link,
a.prompt-link:hover {
color: var(--green);
text-decoration: none;
text-shadow: none;
}
/* Blinkender Terminal-Cursor hinter dem Prompt */
.cursor {
display: inline-block;
@@ -142,7 +150,7 @@ main div.sec0 {
img {
display: block; /* Text startet immer unter dem Bild */
max-width: 500px; /* Desktop: maximal 500px breit */
max-width: 1200px; /* Desktop: maximal 500px breit */
height: auto;
border: 1px solid #333333; /* dunkelgrauer Rand */
margin: .8rem 0;
+3 -3
View File
@@ -10,7 +10,7 @@
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<div class="prompt">user@hfg_linux_group:~$ free-software-for-art-and-design<span class="cursor"></span></div>
<div class="prompt"><a class="prompt-link" href="index.html">user@hfg_linux_group:~$ free-software-for-art-and-design</a><span class="cursor"></span></div>
<header>
<div class="pixel-horse-container">
<svg class="pixel-horse" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><rect x="20" y="45" width="60" height="30" fill="#00ffff" /><rect x="55" y="25" width="30" height="25" fill="#00ffff" /><rect x="55" y="20" width="10" height="10" fill="#00ffff" /><rect x="75" y="20" width="10" height="10" fill="#00ffff" /><rect x="65" y="30" width="5" height="5" fill="#000000" /><rect x="80" y="30" width="5" height="5" fill="#000000" /><rect x="70" y="45" width="3" height="3" fill="#000000" /><rect x="78" y="45" width="3" height="3" fill="#000000" /><rect x="55" y="25" width="5" height="5" fill="#ff00ff" /><rect x="60" y="20" width="5" height="5" fill="#ff00ff" /><rect x="65" y="25" width="5" height="5" fill="#ff00ff" /><rect x="70" y="20" width="5" height="5" fill="#ff00ff" /><rect x="75" y="25" width="5" height="5" fill="#ff00ff" /><rect x="25" y="70" width="8" height="20" fill="#00ffff" /><rect x="40" y="75" width="8" height="15" fill="#00ffff" /><rect x="60" y="70" width="8" height="20" fill="#00ffff" /><rect x="75" y="75" width="8" height="15" fill="#00ffff" /><rect x="10" y="50" width="10" height="20" fill="#ff00ff" /><rect x="5" y="60" width="10" height="10" fill="#ff00ff" /><rect x="25" y="85" width="8" height="5" fill="#008888" /><rect x="60" y="85" width="8" height="5" fill="#008888" /></svg>
@@ -18,7 +18,7 @@
<svg class="pixel-horse" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><rect x="20" y="45" width="60" height="30" fill="#00ffff" /><rect x="55" y="25" width="30" height="25" fill="#00ffff" /><rect x="55" y="20" width="10" height="10" fill="#00ffff" /><rect x="75" y="20" width="10" height="10" fill="#00ffff" /><rect x="65" y="30" width="5" height="5" fill="#000000" /><rect x="80" y="30" width="5" height="5" fill="#000000" /><rect x="70" y="45" width="3" height="3" fill="#000000" /><rect x="78" y="45" width="3" height="3" fill="#000000" /><rect x="55" y="25" width="5" height="5" fill="#ff00ff" /><rect x="60" y="20" width="5" height="5" fill="#ff00ff" /><rect x="65" y="25" width="5" height="5" fill="#ff00ff" /><rect x="70" y="20" width="5" height="5" fill="#ff00ff" /><rect x="75" y="25" width="5" height="5" fill="#ff00ff" /><rect x="25" y="70" width="8" height="20" fill="#00ffff" /><rect x="40" y="75" width="8" height="15" fill="#00ffff" /><rect x="60" y="70" width="8" height="20" fill="#00ffff" /><rect x="75" y="75" width="8" height="15" fill="#00ffff" /><rect x="10" y="50" width="10" height="20" fill="#ff00ff" /><rect x="5" y="60" width="10" height="10" fill="#ff00ff" /><rect x="25" y="85" width="8" height="5" fill="#008888" /><rect x="60" y="85" width="8" height="5" fill="#008888" /></svg>
<svg class="pixel-horse" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><rect x="20" y="45" width="60" height="30" fill="#00ffff" /><rect x="55" y="25" width="30" height="25" fill="#00ffff" /><rect x="55" y="20" width="10" height="10" fill="#00ffff" /><rect x="75" y="20" width="10" height="10" fill="#00ffff" /><rect x="65" y="30" width="5" height="5" fill="#000000" /><rect x="80" y="30" width="5" height="5" fill="#000000" /><rect x="70" y="45" width="3" height="3" fill="#000000" /><rect x="78" y="45" width="3" height="3" fill="#000000" /><rect x="55" y="25" width="5" height="5" fill="#ff00ff" /><rect x="60" y="20" width="5" height="5" fill="#ff00ff" /><rect x="65" y="25" width="5" height="5" fill="#ff00ff" /><rect x="70" y="20" width="5" height="5" fill="#ff00ff" /><rect x="75" y="25" width="5" height="5" fill="#ff00ff" /><rect x="25" y="75" width="8" height="15" fill="#00ffff" /><rect x="40" y="70" width="8" height="20" fill="#00ffff" /><rect x="60" y="75" width="8" height="15" fill="#00ffff" /><rect x="75" y="70" width="8" height="20" fill="#00ffff" /><rect x="10" y="50" width="10" height="20" fill="#ff00ff" /><rect x="5" y="60" width="10" height="10" fill="#ff00ff" /><rect x="40" y="85" width="8" height="5" fill="#008888" /><rect x="75" y="85" width="8" height="5" fill="#008888" /></svg>
</div>
<nav class="anker-nav"><ul><li><a href="#impressum">Impressum</a></li><li><a href="#umsatzsteuer-id">Umsatzsteuer-ID</a></li><li><a href="#rechtsform">Rechtsform</a></li><li><a href="#rechtsaufsicht">Rechtsaufsicht</a></li><li><a href="#haftungsausschluss">Haftungsausschluss</a></li><li><a href="#haftung-fuer-links">Haftung für Links</a></li><li><a href="#hinweise-zum-urheberrecht">Hinweise zum Urheberrecht</a></li><li><a href="#datenschutzerklaerung">Datenschutzerklärung</a></li></ul></nav>
<nav class="anker-nav"><ul><li><a href="index.html#was-ist-die-hfg-linux-usergroup">Was ist die hfg_linux_usergroup</a></li><li><a href="index.html#naechste-treffen">Nächste Treffen</a><ul><li><a href="index.html#hfg-linux-usergroup-date-1-music">hfg_linux_usergroup_date_1_music</a></li><li><a href="index.html#hfg-linux-usergroup-date-2-image-editing">hfg_linux_usergroup_date_2_image-editing</a></li><li><a href="index.html#hfg-linux-usergroup-date-3-coding-development">hfg_linux_usergroup_date_3_coding-development</a></li><li><a href="index.html#hfg-linux-usergroup-date-4-3d-film-fotogrammetrie">hfg_linux_usergroup_date_4_3d-film-fotogrammetrie</a></li></ul></li><li><a href="index.html#wer-ist-die-hfg-linux-usergroup">Wer ist die hfg_linux_usergroup</a></li><li><a href="index.html#was-sind-die-ziele-der-hfg-linux-usergroup">Was sind die Ziele der hfg_linux_usergroup</a></li><li><a href="index.html#das-hfg-os">Das hfg_OS_</a><ul><li><a href="index.html#versionen">Versionen</a><ul><li><a href="index.html#haftungsausschluss-disclaimer">Haftungsausschluss / Disclaimer</a></li></ul></li><li><a href="index.html#integrierte-programme">Integrierte Programme</a></li></ul></li></ul></nav>
</header>
<main>
<div class="sec0">
@@ -60,7 +60,7 @@
</div>
</main>
<footer>
<p>Dieser Footer-Baustein wird automatisch an das Ende <strong>aller</strong> Seiten gesetzt. Zum Beispiel mit Links: <a href="index.html">Startseite</a></p>
<p><a href="impressum.html">Impressum</a></p>
</footer>
</body>
</html>
+3 -3
View File
@@ -10,7 +10,7 @@
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<div class="prompt">user@hfg_linux_group:~$ free-software-for-art-and-design<span class="cursor"></span></div>
<div class="prompt"><a class="prompt-link" href="index.html">user@hfg_linux_group:~$ free-software-for-art-and-design</a><span class="cursor"></span></div>
<header>
<div class="pixel-horse-container">
<svg class="pixel-horse" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><rect x="20" y="45" width="60" height="30" fill="#00ffff" /><rect x="55" y="25" width="30" height="25" fill="#00ffff" /><rect x="55" y="20" width="10" height="10" fill="#00ffff" /><rect x="75" y="20" width="10" height="10" fill="#00ffff" /><rect x="65" y="30" width="5" height="5" fill="#000000" /><rect x="80" y="30" width="5" height="5" fill="#000000" /><rect x="70" y="45" width="3" height="3" fill="#000000" /><rect x="78" y="45" width="3" height="3" fill="#000000" /><rect x="55" y="25" width="5" height="5" fill="#ff00ff" /><rect x="60" y="20" width="5" height="5" fill="#ff00ff" /><rect x="65" y="25" width="5" height="5" fill="#ff00ff" /><rect x="70" y="20" width="5" height="5" fill="#ff00ff" /><rect x="75" y="25" width="5" height="5" fill="#ff00ff" /><rect x="25" y="70" width="8" height="20" fill="#00ffff" /><rect x="40" y="75" width="8" height="15" fill="#00ffff" /><rect x="60" y="70" width="8" height="20" fill="#00ffff" /><rect x="75" y="75" width="8" height="15" fill="#00ffff" /><rect x="10" y="50" width="10" height="20" fill="#ff00ff" /><rect x="5" y="60" width="10" height="10" fill="#ff00ff" /><rect x="25" y="85" width="8" height="5" fill="#008888" /><rect x="60" y="85" width="8" height="5" fill="#008888" /></svg>
@@ -56,7 +56,7 @@
</div>
<div class="sec0">
<h1 id="das-hfg-os">Das hfg_OS_</h1>
<p><img src="images/hfg_os_background_1_fullhd.jpg" alt="hfg_os_background_1_fullhd"> Das hfg_OS ist ein auf Debian 13 (Trixie) basierendes, Linux-basiertes Betriebssystem. Es wurde speziell für die Bedürfnisse von Künstler:innen und Designer:innen angepasst und wird kontinuierlich weiterentwickelt.</p>
<p>Das hfg_OS ist ein auf Debian 13 (Trixie) basierendes, Linux-basiertes Betriebssystem. Es wurde speziell für die Bedürfnisse von Künstler:innen und Designer:innen angepasst und wird kontinuierlich weiterentwickelt. <img src="images/hfg_os_background_1_fullhd.jpg" alt="hfg_os_background_1_fullhd"></p>
<div class="sec">
<h2 id="versionen">Versionen</h2>
<table><thead><tr><th style="text-align: left">Version</th><th style="text-align: center">Name</th><th style="text-align: right">Platform</th><th>Filesize</th></tr></thead><tbody><tr><td style="text-align: left">12.10.</td><td style="text-align: center">hfg_OS_Falbella</td><td style="text-align: right">X86</td><td>4536 MB</td></tr></tbody></table>
@@ -73,7 +73,7 @@
</div>
</main>
<footer>
<p>Dieser Footer-Baustein wird automatisch an das Ende <strong>aller</strong> Seiten gesetzt. Zum Beispiel mit Links: <a href="index.html">Startseite</a></p>
<p><a href="impressum.html">Impressum</a></p>
</footer>
</body>
</html>
+1 -1
View File
@@ -10,7 +10,7 @@
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<div class="prompt">user@hfg_linux_group:~$ free-software-for-art-and-design<span class="cursor"></span></div>
<div class="prompt"><a class="prompt-link" href="index.html">user@hfg_linux_group:~$ free-software-for-art-and-design</a><span class="cursor"></span></div>
<header>
{{header}}
<nav class="anker-nav">{{anker}}</nav>
+25
View File
@@ -0,0 +1,25 @@
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{{titel}}</title>
<meta name="description" content="{{beschreibung}}">
<link rel="icon" type="image/png" href="images/hfglogo.png">
<link rel="icon" type="image/svg+xml" href="images/logo.svg">
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<div class="prompt"><a class="prompt-link" href="index.html">user@hfg_linux_group:~$ free-software-for-art-and-design</a><span class="cursor"></span></div>
<header>
{{header}}
<nav class="anker-nav">{{anker-start}}</nav>
</header>
<main>
{{inhalt}}
</main>
<footer>
{{footer}}
</footer>
</body>
</html>