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
+65
View File
@@ -0,0 +1,65 @@
#!/bin/bash
# Fetches the current state of the separate methods repo
# (ableger_demo/ableger_methoden) into ./_content - for local development and
# in the deploy hook on Uberspace. _content/ is deliberately not part of this
# repo (see .gitignore) and is freshly fetched here on every call instead of
# being pinned as a submodule. Hugo mounts _content/methoden (see
# hugo/hugo.toml) - the content repo itself contains a methoden/ subfolder,
# not just the methods directly at its root (Decap CMS workaround, see
# admin/config.yml).
set -euo pipefail
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
# shellcheck source=/dev/null
source "$ROOT/install.env"
# ABLEGER_METHODEN_URL completely overrides this fallback in the deploy hook
# (a local filesystem path on the same Uberspace account, see
# the installation guide on the project website) - the SSH fallback built here from install.env is
# only needed for local development without that environment variable set.
REPO_URL="${ABLEGER_METHODEN_URL:-ssh://${GITEA_SSH_USER}@${GITEA_DOMAIN}:${GITEA_SSH_PORT}/${METHODEN_REPO}.git}"
TARGET="$ROOT/_content"
if [ -d "$TARGET/.git" ]; then
# "remote set-url" ALWAYS before the fetch, not only on first clone: an
# already existing worktree otherwise keeps the remote URL from its
# original clone time, even if REPO_URL has changed since (e.g. after a
# repo rename/transfer to a different organization). This broke live
# exactly this way: after transferring ableger_methoden to the
# "ableger_demo" organization, the worktree already present on the server
# kept pointing at the old path (tobias/ableger_methoden.git), and the
# cron job then failed on every run (every 10 minutes) until this was
# fixed manually.
git -C "$TARGET" remote set-url origin "$REPO_URL"
git -C "$TARGET" fetch origin main
git -C "$TARGET" reset --hard origin/main
else
rm -rf "$TARGET"
git clone "$REPO_URL" "$TARGET"
fi
echo "_content/ aktuell: $(git -C "$TARGET" rev-parse --short HEAD)"
# Validate against the Manifest chapter on the project website (website repo) BEFORE
# apply-veroeffentlicht.rb and compute-methoden-sichtbarkeit.rb translate the
# state for Hugo - the validation script needs the real, committed state
# (with "veroeffentlicht", without Hugo's "draft"), otherwise its own rules
# (e.g. Regel 12: no derived fields stored) could never be satisfiable
# against its own translation. set -e above ensures that an error (exit
# code 1) here aborts the entire sync/build before a broken reference or
# similar goes live unnoticed (see the project website (background/analysis notes), Befund A/B) -
# warnings (exit code 0) deliberately do not block.
ruby "$(dirname "${BASH_SOURCE[0]}")/validate.rb"
# Recompute creation dates from the freshly fetched history.
"$(dirname "${BASH_SOURCE[0]}")/generate-dates.sh"
# Translate the variants' "veroeffentlicht" field (positive polarity) into
# Hugo's native draft field - must run before compute-methoden-
# sichtbarkeit.rb, which reads that draft field. See
# admin/config.template.yml and the script's own comments.
ruby "$(dirname "${BASH_SOURCE[0]}")/apply-veroeffentlicht.rb"
# Mark methods without a published variant as draft, locally (not in the
# content repo) - see admin/config.template.yml and the script's own comment.
ruby "$(dirname "${BASH_SOURCE[0]}")/compute-methoden-sichtbarkeit.rb"