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.
67 lines
3.3 KiB
HTML
67 lines
3.3 KiB
HTML
{{ define "main" }}
|
||
{{/* A dedicated, deliberately simple full-text search via Pagefind instead
|
||
of trying to merge it here with the homepage's facet search
|
||
(index.html, filter.js) into one component: Pagefind only knows
|
||
pages/URLs, not the method-vs-variant relationship, so mixing it with
|
||
the card facets there would be a lot of glue code for little benefit.
|
||
Robustness over feature scope: Pagefind's own bundled default widget
|
||
(PagefindUI) instead of custom rendering of the results - see
|
||
https://pagefind.app/docs/ui/. The index itself is only created AFTER
|
||
the Hugo build (command-line step "pagefind --site public", see
|
||
the installation guide on the project website) - under "hugo server" there is no index yet,
|
||
see the note below in the script. */}}
|
||
<section class="search-page" data-pagefind-ignore="all">
|
||
<h1>{{ .Title }}</h1>
|
||
<p class="search-page__hint">
|
||
Durchsucht alle veröffentlichten Methoden und Varianten vollständig –
|
||
auch Vorbereitung, Ablauf und Hintergründe, nicht nur Titel und Tags.
|
||
Für eine schnelle Filterung nach Zielgruppe, Kompetenzbereich, Kategorie,
|
||
Dauer oder Gruppengröße: <a href="{{ "/" | relURL }}">Startseite mit Filtern</a>.
|
||
</p>
|
||
<div id="pagefind-suche"></div>
|
||
</section>
|
||
|
||
<link href="{{ "pagefind/pagefind-ui.css" | relURL }}" rel="stylesheet">
|
||
<script src="{{ "pagefind/pagefind-ui.js" | relURL }}" defer></script>
|
||
<script>
|
||
document.addEventListener("DOMContentLoaded", function () {
|
||
// "pagefind-ui.js" only exists after the separate indexing step
|
||
// following the Hugo build (see comment above) - deliberately stay
|
||
// silent here without an index instead of showing an error, e.g. under
|
||
// "hugo server".
|
||
if (typeof PagefindUI === "undefined") return;
|
||
|
||
var ui = new PagefindUI({
|
||
element: "#pagefind-suche",
|
||
showSubResults: true,
|
||
autofocus: true,
|
||
// German translation given explicitly instead of relying on
|
||
// Pagefind's automatic language detection via <html lang>: more
|
||
// robust against differing locale spellings (here "de-DE" instead
|
||
// of "de"), see hugo/layouts/_default/baseof.html. Wording taken
|
||
// 1:1 from Pagefind's own de.json.
|
||
translations: {
|
||
placeholder: "Suchen",
|
||
clear_search: "Löschen",
|
||
load_more: "Weitere Ergebnisse laden",
|
||
search_label: "Diese Seite durchsuchen",
|
||
filters_label: "Filter",
|
||
zero_results: "Keine Ergebnisse für [SEARCH_TERM]",
|
||
many_results: "[COUNT] Ergebnisse für [SEARCH_TERM]",
|
||
one_result: "Ein Ergebnis für [SEARCH_TERM]",
|
||
alt_search: "Keine Ergebnisse für [SEARCH_TERM]. Stattdessen erscheinen Ergebnisse für [DIFFERENT_TERM].",
|
||
search_suggestion: "Keine Ergebnisse für [SEARCH_TERM]. Probier einen der folgenden Vorschläge:",
|
||
searching: "[SEARCH_TERM] wird gesucht …"
|
||
}
|
||
});
|
||
|
||
// Takes ?q=... from the URL (from the search field in the header, see
|
||
// baseof.html - whose form now submits here instead of to the
|
||
// homepage) as a pre-filled search, the documented way via the
|
||
// PagefindUI instance method, see https://pagefind.app/docs/ui/.
|
||
var q = new URLSearchParams(window.location.search).get("q");
|
||
if (q) ui.triggerSearch(q);
|
||
});
|
||
</script>
|
||
{{ end }}
|