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:
@@ -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>
|
||||
Reference in New Issue
Block a user