Files
website/scripts/generate-version-info.sh
T
tobias 5e9da58d23 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.
2026-08-23 14:37:54 +02:00

27 lines
1.2 KiB
Bash
Executable File

#!/bin/bash
# Generates hugo/data/website.json: the current commit (short hash + date)
# of THIS website/CMS-code repo itself - shown in the footer next to the
# Manifest version (see baseof.html) so an installation can tell at a
# glance which code state it's actually running, independent of whether
# it's still identical to the template or has since been developed further
# on its own. Deliberately NOT a frozen "forked from template version X"
# marker - once a fork's own commits land, this reflects those, not the
# template's history.
#
# Unlike hugo/data/methoden.json/varianten.json (generate-dates.sh), this
# reads the website repo's own git history directly - no separate
# module.mounts repo involved, Hugo's enableGitInfo/.GitInfo would actually
# work here, but a plain "git log" call keeps this consistent with the
# same approach already used for methoden/varianten dates.
set -euo pipefail
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
OUT="$ROOT/hugo/data/website.json"
mkdir -p "$(dirname "$OUT")"
commit="$(git -C "$ROOT" rev-parse --short HEAD)"
datum="$(git -C "$ROOT" log -1 --format=%aI)"
jq -n --arg commit "$commit" --arg datum "$datum" '{commit: $commit, datum: $datum}' > "$OUT"
echo "website.json aktualisiert: $commit ($datum)"