Vorlage fuer eigene Ableger-Installationen: Website + CMS-Code

Bereinigt von Pilot-Spezifika (echte Inhalte, Erzbistum-Hamburg-Bezuege,
Domain-Werte) - install.env und hugo.toml [params] mit generischen
Platzhaltern. docs/ komplett entfernt: Konzept, Manifest, Installations-
anleitungen leben jetzt auf der Projekt-Website statt redundant im Repo,
README verweist dorthin. Decap-CMS-Version von einer floatenden ^3.0.0
auf ein festes 3.15.1 gepinnt.
This commit is contained in:
2026-08-23 14:37:54 +02:00
commit 5e9da58d23
65 changed files with 5073 additions and 0 deletions
@@ -0,0 +1,18 @@
{{/* We resolve image paths in variant content (![](datei.svg)) via the
page resources of the page the content belongs to (the variant) - not
the page that embeds .Content. With only one variant, the method page
(hugo/layouts/_default/single.html) embeds this content directly; a
raw relative path would resolve against the wrong URL there (the file
lives in the variant's bundle folder, not the method's). An absolute
permalink makes the embed location-independent. */}}
{{- $resource := "" }}
{{- if not (urls.Parse .Destination).IsAbs }}
{{- with .Page.Resources.GetMatch .Destination }}
{{- $resource = . }}
{{- end }}
{{- end }}
{{- if $resource }}
<img src="{{ $resource.Permalink }}" alt="{{ .Text }}"{{ with .Title }} title="{{ . }}"{{ end }}>
{{- else }}
<img src="{{ .Destination }}" alt="{{ .Text }}"{{ with .Title }} title="{{ . }}"{{ end }}>
{{- end }}
+191
View File
@@ -0,0 +1,191 @@
<!DOCTYPE html>
<html lang="{{ .Site.Language.Locale | default "de" }}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
{{ $seiten_titel := .Params.titel | default .Title }}
{{ $beschreibung := .Params.kurzbeschreibung | default .Site.Params.beschreibung }}
{{ if eq .Section "varianten" }}
{{ with partial "methode-fuer-variante.html" . }}
{{ $seiten_titel = printf "%s – %s" (.Params.titel | default .Title) $.Params.untertitel }}
{{ $beschreibung = .Params.kurzbeschreibung | default $.Site.Params.beschreibung }}
{{ end }}
{{ end }}
<title>{{ if .IsHome }}{{ .Site.Title }}{{ else }}{{ $seiten_titel }} · {{ .Site.Title }}{{ end }}</title>
<meta name="description" content="{{ if .IsHome }}{{ .Site.Params.beschreibung }}{{ else }}{{ $beschreibung }}{{ end }}">
<link rel="stylesheet" href="{{ "css/style.css" | relURL }}">
{{/* SVG first: has dark-mode switching built in (@media
prefers-color-scheme within the file itself) and is preferred by
current browsers. The PNG variants below are the fallback for
browsers/contexts without SVG favicon support - since PNGs can't do
@media queries themselves, there's a separate light/dark pair for
them with media="(prefers-color-scheme: ...)" on the <link> itself
(introduced by Safari, meanwhile more widely supported). Without
this, the PNG fallback would be low-contrast in dark browser chrome
(dark green icon on a transparent background). */}}
<link rel="icon" href="{{ "favicon.svg" | relURL }}" type="image/svg+xml">
<link rel="icon" href="{{ "favicon-32x32.png" | relURL }}" sizes="32x32" type="image/png" media="(prefers-color-scheme: light)">
<link rel="icon" href="{{ "favicon-16x16.png" | relURL }}" sizes="16x16" type="image/png" media="(prefers-color-scheme: light)">
<link rel="icon" href="{{ "favicon-32x32-dark.png" | relURL }}" sizes="32x32" type="image/png" media="(prefers-color-scheme: dark)">
<link rel="icon" href="{{ "favicon-16x16-dark.png" | relURL }}" sizes="16x16" type="image/png" media="(prefers-color-scheme: dark)">
<link rel="apple-touch-icon" href="{{ "apple-touch-icon.png" | relURL }}">
{{ with .Site.Params.farbe_primaer }}
<style>:root{ --color-accent: {{ . }}; }</style>
{{ end }}
</head>
<body>
<header class="site-header">
<a class="site-title" href="{{ "/" | relURL }}">
<img src="{{ "img/logo.svg" | relURL }}" alt="" class="site-logo" width="32" height="32">
{{ .Site.Title }}
</a>
<div class="site-header__actions">
{{/* On a wide screen, a real, always-visible search bar; on narrow
screens it expands via the button. Deliberately NO <details>
here AND for "Stöbern" (browse) (unlike an earlier version):
<details> internally collapses to 0×0 in current Chromium
versions as soon as you try to override the closed state via CSS
(reproduced live) - and has no native "expand on hover" anyway.
Instead both are a button + CSS-driven panel, visible via hover
(only on pointer devices with hover, see style.css), keyboard
focus, or click/tap - click/tap for touch devices without hover,
see inline script below. Also works completely without
JavaScript: a real <form method="get">, submitting navigates to
/?q=... - filter.js prevents that only on the homepage itself
and filters live instead, see there. */}}
<div class="header-search" id="header-search">
<button type="button" class="header-toggle" id="header-search-toggle" aria-expanded="false" aria-controls="header-search-form">Suchen</button>
{{/* Target since the introduction of Pagefind full-text search:
/suche/ instead of / - filter.js still only prevents
submission on the homepage itself (that's where the fast
metadata filtering over the cards lives, see there); on every
other page a real <form method="get"> now navigates to the
full-text search instead of the weaker metadata search on the
homepage. */}}
<form class="header-search__form" id="header-search-form" action="{{ "/suche/" | relURL }}" method="get" role="search">
<label for="header-search-input" class="visually-hidden">Suchen</label>
<input type="search" name="q" id="header-search-input" placeholder="Titel, Beschreibung, Tags …" autocomplete="off">
</form>
</div>
{{/* "Stöbern" (browse) always expands regardless of screen width -
the same four overview pages as previously in the main
navigation. */}}
<div class="header-browse" id="header-browse">
<button type="button" class="header-toggle" id="header-browse-toggle" aria-expanded="false" aria-controls="header-browse-nav">Stöbern</button>
<nav class="header-browse__nav" id="header-browse-nav">
<a href="{{ "/zielgruppe/" | relURL }}">Zielgruppen</a>
<a href="{{ "/kompetenzbereich/" | relURL }}">Kompetenzbereiche</a>
<a href="{{ "/kategorie/" | relURL }}">Kategorien</a>
<a href="{{ "/tags/" | relURL }}">Tags</a>
</nav>
</div>
{{/* Standalone, static app outside of Hugo (like /admin/, see
hugo/hugo.toml module.mounts) - hence a plain link instead of a
relURL reference to a Hugo page. A user-visible feature, so it
lives here in the header next to Suchen/Stöbern, not in the
footer next to Redaktion/Status (see the Methoden-Set chapter on the project website). */}}
<a href="/methoden-set/" class="header-toggle header-toggle--link">Methoden-Set</a>
</div>
</header>
<script>
// Runs on every page (unlike filter.js, which exits immediately if
// #method-grid is missing) - drives click/tap toggling for
// "Suchen"/"Stöbern" (hover itself is plain CSS, see style.css) and
// keeps the search open once something has been entered, even after
// the mouse moves away again or the field loses focus.
(function () {
function wireToggle(wrapperId, toggleId, staysOpen) {
var wrapper = document.getElementById(wrapperId);
var toggle = document.getElementById(toggleId);
if (!wrapper || !toggle) return;
function setOpen(open) {
wrapper.classList.toggle("is-open", open);
toggle.setAttribute("aria-expanded", String(open));
}
toggle.addEventListener("click", function () {
setOpen(!wrapper.classList.contains("is-open"));
});
document.addEventListener("click", function (event) {
if (wrapper.contains(event.target)) return;
if (staysOpen && staysOpen()) return;
setOpen(false);
});
return setOpen;
}
var searchInput = document.getElementById("header-search-input");
var searchHasValue = function () {
return !!(searchInput && searchInput.value.trim());
};
var setSearchOpen = wireToggle("header-search", "header-search-toggle", searchHasValue);
wireToggle("header-browse", "header-browse-toggle", null);
if (searchInput && setSearchOpen) {
searchInput.addEventListener("input", function () {
setSearchOpen(searchHasValue());
});
}
})();
</script>
{{/* data-pagefind-body limits the area indexed by Pagefind to the actual
page content - without this attribute, Pagefind would also index the
header (logo, "Suchen"/"Stöbern", navigation) and footer on every
single page, and every search hit would additionally carry these
terms in the index. This lives here in baseof.html, so it applies
equally to every page - no risk that individual pages drop out of
the index because of it (per Pagefind's own docs: "if
data-pagefind-body appears anywhere on the site, pages without this
attribute are no longer indexed at all"). */}}
<main class="site-main" data-pagefind-body>
{{ block "main" . }}{{ end }}
</main>
<footer class="site-footer">
<div class="site-footer__grid">
<div class="site-footer__col">
<h2 class="site-footer__heading">Ableger</h2>
<p>Ableger ist ein Framework zur Sammlung und Entwicklung von Methoden.</p>
<ul class="site-footer__links">
{{ with .Site.Params.website_repo_url }}<li><a href="{{ . }}">Ableger-Projekt</a></li>{{ else }}<li><span class="site-footer__placeholder" title="Folgt">Ableger-Projekt</span></li>{{ end }}
<li><a href="https://gohugo.io">Hugo</a></li>
<li><a href="https://decapcms.org">Decap CMS</a></li>
<li><a href="https://pagefind.app">Pagefind</a></li>
<li><a href="https://pandoc.org">Pandoc</a></li>
</ul>
</div>
<div class="site-footer__col">
<h2 class="site-footer__heading">Instanz</h2>
<ul class="site-footer__links">
{{ with .Site.Params.methoden_repo_url }}<li><a href="{{ . }}">Quell-Repository</a></li>{{ end }}
{{ if .Site.Params.betreiber_url }}<li>Betreiber: <a href="{{ .Site.Params.betreiber_url }}">{{ .Site.Params.betreiber_name }}</a></li>{{ else }}<li>Betreiber: {{ .Site.Params.betreiber_name }}</li>{{ end }}
{{ with hugo.Data.ableger }}<li>Manifest-Version {{ .protokoll_version }}</li>{{ end }}
{{/* Current commit of THIS website repo, not a frozen "forked
from template version X" marker - see
scripts/generate-version-info.sh. Deliberately separate from
"Manifest-Version" above: that one is a rarely-changing
structural compatibility marker for the data model, this one
changes with every deploy and reflects the code actually
running here (still identical to the template initially,
diverges once a fork develops further on its own). */}}
{{ with hugo.Data.website }}<li>Stand: {{ .commit }} ({{ .datum | time.AsTime | dateFormat "02.01.2006" }})</li>{{ end }}
</ul>
</div>
<div class="site-footer__col">
<ul class="site-footer__links">
{{ with .Site.Params.impressum_url }}<li><a href="{{ . }}">Impressum</a></li>{{ else }}<li><span class="site-footer__placeholder" title="Folgt">Impressum</span></li>{{ end }}
{{ with .Site.Params.datenschutz_url }}<li><a href="{{ . }}">Datenschutz</a></li>{{ else }}<li><span class="site-footer__placeholder" title="Folgt">Datenschutz</span></li>{{ end }}
<li><a href="{{ "/admin/" | relURL }}">Redaktion</a></li>
<li><a href="{{ "/admin/status/" | relURL }}">Status</a></li>
</ul>
</div>
</div>
</footer>
<script src="{{ "js/filter.js" | relURL }}" defer></script>
</body>
</html>
+11
View File
@@ -0,0 +1,11 @@
{{ define "main" }}
<section class="method-list">
<h1>{{ .Title }}</h1>
{{ with .Content }}<div class="taxonomy-intro">{{ . }}</div>{{ end }}
<div class="method-grid">
{{ range sort .Pages "Params.titel" }}
{{ partial "method-card.html" . }}
{{ end }}
</div>
</section>
{{ end }}
+40
View File
@@ -0,0 +1,40 @@
{{ define "main" }}
{{ $methode := . }}
<article class="method">
<header class="method__header">
<h1>{{ .Params.titel | default .Title }}</h1>
{{ with .Params.kurzbeschreibung }}<p class="method__lead">{{ . }}</p>{{ end }}
{{ with index hugo.Data.methoden $.File.ContentBaseName }}
<p class="method__updated">Erstellt: {{ .erstellt | time.AsTime | dateFormat "02.01.2006" }}</p>
<p class="method__updated">Zuletzt geändert: {{ .geaendert | time.AsTime | dateFormat "02.01.2006" }}</p>
{{ end }}
</header>
{{ partial "steckbrief-box.html" (dict "methode" $methode "zeigeKurzbeschreibung" false "zeigeLink" false) }}
{{/* Linked via Params.kennung, not via Params.titel or the folder
name/slug: the title may change at any time (see
the Manifest chapter on the project website), the kennung may not - Decap's relation widget
therefore stores the method's kennung in the variant's "methode"
field (value_field: "kennung" in admin/config.template.yml). */}}
{{ $varianten := partial "varianten-fuer-methode.html" . }}
{{ $varianten = sort $varianten "Params.untertitel" }}
{{ if eq (len $varianten) 1 }}
{{ with index $varianten 0 }}
{{ partial "diese-variante.html" . }}
<div class="method__body">
{{ .Content }}
</div>
{{ partial "attachments.html" . }}
{{ end }}
{{ else if gt (len $varianten) 1 }}
<section class="method__section">
<h2>Varianten</h2>
<div class="variant-grid">
{{ range $varianten }}{{ partial "variante-card.html" . }}{{ end }}
</div>
</section>
{{ end }}
</article>
{{ end }}
+27
View File
@@ -0,0 +1,27 @@
{{/* Served under "<method-url>index.md" (see [outputFormats.MethodenSetMd]
and the second cascade rule in hugo/hugo.toml), for the methoden-set
tool (methoden-set/, see the Methoden-Set chapter on the project website). Same "one variant ->
embed" logic as _default/single.html (see there): if the method has
exactly one variant, this URL returns exactly the same document as
the variant URL itself (partials/methoden-set-dokument.html) - methods
with only one variant otherwise have no URL usable via the tool,
because the HTML page embeds the variant text directly, without
showing a visible link to the actual variant URL. With 0 or several
variants, a short notice document instead of a generic 404 in the
tool - see its error messages in methoden-set/app.js. */}}
{{- $methode := . -}}
{{- $varianten := partial "varianten-fuer-methode.html" . -}}
{{- if eq (len $varianten) 1 -}}
{{- partial "methoden-set-dokument.html" (index $varianten 0) -}}
{{- else -}}
---
titel: {{ (.Params.titel | default .Title) | jsonify }}
quelle: {{ .Permalink | jsonify }}
fehler: {{ if gt (len $varianten) 1 }}"mehrere_varianten"{{ else }}"keine_variante"{{ end }}
---
{{ if gt (len $varianten) 1 -}}
Diese Methode hat mehrere Varianten. Bitte auf der Methoden-Seite die gewünschte Variante öffnen und deren eigenen Link einfügen.
{{- else -}}
Diese Methode hat noch keine veröffentlichte Variante.
{{- end }}
{{- end -}}
+10
View File
@@ -0,0 +1,10 @@
{{ define "main" }}
<section class="taxonomy-overview">
<h1>{{ .Title }}</h1>
<ul class="filter-list">
{{ range .Pages }}
<li><a href="{{ .RelPermalink }}">{{ .Title }}</a> ({{ len .Pages }})</li>
{{ end }}
</ul>
</section>
{{ end }}