diff --git a/configs/bank-landing/index.html b/configs/bank-landing/index.html
index b9ab241..8efca46 100644
--- a/configs/bank-landing/index.html
+++ b/configs/bank-landing/index.html
@@ -1102,7 +1102,17 @@
border-radius: 10px;
}
.shop-foot a:hover { filter: brightness(1.06); }
-
+ .landing-rev {
+ margin: 0.75rem 0 0;
+ font-size: 0.72rem;
+ color: var(--muted, #9a8fb0);
+ line-height: 1.45;
+ text-align: center;
+ }
+ .landing-rev a { color: inherit; text-decoration: underline; text-underline-offset: 2px; opacity: 0.95; }
+ .landing-rev strong { font-weight: 750; }
+
+
+ Landing v42 + · content + · aa3c23b +
+ diff --git a/configs/exchange-landing/index.html b/configs/exchange-landing/index.html index cf671ad..a79a3e9 100644 --- a/configs/exchange-landing/index.html +++ b/configs/exchange-landing/index.html @@ -274,7 +274,17 @@ footer { margin-top: 1.75rem; text-align: center; color: var(--muted); font-size: 0.85rem; } footer a { color: #e8c878; } code { font-family: ui-monospace, Menlo, monospace; font-size: 0.86em; background: rgba(0,0,0,0.35); padding: 0.1em 0.35em; border-radius: 4px; color: #f0d090; } - + .landing-rev { + margin: 0.75rem 0 0; + font-size: 0.72rem; + color: var(--muted, #9a8fb0); + line-height: 1.45; + text-align: center; + } + .landing-rev a { color: inherit; text-decoration: underline; text-underline-offset: 2px; opacity: 0.95; } + .landing-rev strong { font-weight: 750; } + + + ++ Landing v42 + · content + · aa3c23b +
+ diff --git a/configs/merchant-landing/index.html b/configs/merchant-landing/index.html index 1a14014..ae66805 100644 --- a/configs/merchant-landing/index.html +++ b/configs/merchant-landing/index.html @@ -517,7 +517,17 @@ .sym-gold path[data-ring], .sym-gold circle[data-ring] { fill: none; stroke: #f0c86a; } .sym-blue path, .sym-blue circle { fill: #3ecfbf; stroke: #3ecfbf; } .sym-blue path[data-ring], .sym-blue circle[data-ring] { fill: none; stroke: #3ecfbf; } - + .landing-rev { + margin: 0.75rem 0 0; + font-size: 0.72rem; + color: var(--muted, #9a8fb0); + line-height: 1.45; + text-align: center; + } + .landing-rev a { color: inherit; text-decoration: underline; text-underline-offset: 2px; opacity: 0.95; } + .landing-rev strong { font-weight: 750; } + + + ++ Landing v42 + · content + · aa3c23b +
+ diff --git a/configs/shared/landing-version.json b/configs/shared/landing-version.json new file mode 100644 index 0000000..ee06829 --- /dev/null +++ b/configs/shared/landing-version.json @@ -0,0 +1,9 @@ +{ + "version": 42, + "updated_iso": "2026-07-17T13:31:56+02:00", + "updated_human": "2026-07-17 13:31 CEST", + "commit": "aa3c23be49236ba5c20cd095bb02790f84aeb1e5", + "commit_short": "aa3c23b", + "repo_commit_url": "https://git.hacktivism.ch/hernani/koopa-admin-log/commit/aa3c23be49236ba5c20cd095bb02790f84aeb1e5", + "note": "Bump with scripts/taler-landing/stamp-landing-version.sh --bump after each landing content change." +} diff --git a/scripts/taler-landing/stamp-landing-version.sh b/scripts/taler-landing/stamp-landing-version.sh new file mode 100755 index 0000000..570636c --- /dev/null +++ b/scripts/taler-landing/stamp-landing-version.sh @@ -0,0 +1,143 @@ +#!/usr/bin/env bash +# Stamp landing footers with version + last content change + linkified commit. +# +# Usage (from koopa-admin-log root): +# ./scripts/taler-landing/stamp-landing-version.sh # re-stamp with HEAD + current version +# ./scripts/taler-landing/stamp-landing-version.sh --bump # version += 1, then stamp HEAD +# ./scripts/taler-landing/stamp-landing-version.sh --set 42 # force version +# +# Typical flow after editing landing HTML/CSS/JS: +# 1) edit landings +# 2) ./scripts/taler-landing/stamp-landing-version.sh --bump +# 3) git add configs/ && git commit +# 4) ./scripts/taler-landing/stamp-landing-version.sh && git add configs/ && git commit --amend --no-edit +# +# Or one-shot (commits for you if GIT_STAMP_COMMIT=1). +set -euo pipefail + +ROOT="$(cd "$(dirname "$0")/../.." && pwd)" +VER_FILE="$ROOT/configs/shared/landing-version.json" +REPO_WEB="${LANDING_REPO_WEB:-https://git.hacktivism.ch/hernani/koopa-admin-log}" +LANDINGS=( + "$ROOT/configs/bank-landing/index.html" + "$ROOT/configs/exchange-landing/index.html" + "$ROOT/configs/merchant-landing/index.html" +) + +export TZ="${TZ:-Europe/Zurich}" + +bump=0 +set_ver="" +while [ $# -gt 0 ]; do + case "$1" in + --bump) bump=1; shift ;; + --set) set_ver="${2:-}"; shift 2 ;; + -h|--help) + sed -n '2,20p' "$0" + exit 0 + ;; + *) echo "unknown arg: $1" >&2; exit 2 ;; + esac +done + +if [ ! -f "$VER_FILE" ]; then + echo '{"version":42,"updated_iso":"","updated_human":"","commit":"","commit_short":""}' >"$VER_FILE" +fi + +version=$(python3 -c 'import json,sys; print(json.load(open(sys.argv[1])).get("version",42))' "$VER_FILE") +if [ -n "$set_ver" ]; then + version="$set_ver" +elif [ "$bump" = 1 ]; then + version=$((version + 1)) +fi + +# Prefer staged/index commit identity after commit; allow OVERRIDE_COMMIT +if [ -n "${OVERRIDE_COMMIT:-}" ]; then + full="$OVERRIDE_COMMIT" +else + full=$(git -C "$ROOT" rev-parse HEAD 2>/dev/null || echo "unknown") +fi +short=$(git -C "$ROOT" rev-parse --short=7 "$full" 2>/dev/null || echo "${full:0:7}") +iso=$(date +%Y-%m-%dT%H:%M:%S%z | sed -E 's/([+-][0-9]{2})([0-9]{2})$/\1:\2/') +human=$(date +"%Y-%m-%d %H:%M %Z") +url="${REPO_WEB}/commit/${full}" + +python3 - "$VER_FILE" "$version" "$iso" "$human" "$full" "$short" "$url" <<'PY' +import json, sys +path, version, iso, human, full, short, url = sys.argv[1:] +data = { + "version": int(version), + "updated_iso": iso, + "updated_human": human, + "commit": full, + "commit_short": short, + "repo_commit_url": url, + "note": "Bump with scripts/taler-landing/stamp-landing-version.sh --bump after each landing content change.", +} +open(path, "w", encoding="utf-8").write(json.dumps(data, indent=2, ensure_ascii=False) + "\n") +print(f"version={version} commit={short} at={human}") +PY + +# HTML block injected into each footer (idempotent via markers) +block=$(cat <+ Landing v${version} + · content + · ${short} +
+ +EOF +) + +css_snip=' .landing-rev { + margin: 0.75rem 0 0; + font-size: 0.72rem; + color: var(--muted, #9a8fb0); + line-height: 1.45; + text-align: center; + } + .landing-rev a { color: inherit; text-decoration: underline; text-underline-offset: 2px; opacity: 0.95; } + .landing-rev strong { font-weight: 750; } +' + +for f in "${LANDINGS[@]}"; do + [ -f "$f" ] || { echo "missing $f" >&2; exit 1; } + # ensure CSS once + if ! grep -q '\.landing-rev' "$f"; then + # insert before of first style block + python3 - "$f" "$css_snip" <<'PY' +import sys +path, snip = sys.argv[1], sys.argv[2] +t = open(path, encoding="utf-8").read() +if ".landing-rev" in t: + sys.exit(0) +idx = t.find("") +if idx < 0: + raise SystemExit(f"no in {path}") +t = t[:idx] + snip + "\n" + t[idx:] +open(path, "w", encoding="utf-8").write(t) +print(f"css → {path}") +PY + fi + # replace or insert rev block before + python3 - "$f" "$block" <<'PY' +import sys, re +path, block = sys.argv[1], sys.argv[2] +t = open(path, encoding="utf-8").read() +block = block.rstrip() + "\n" +pat = re.compile(r"[ \t]*.*?\n?", re.S) +if pat.search(t): + t = pat.sub(block, t, count=1) +else: + # before closing footer + t2, n = re.subn(r"(\n)([ \t]*)", r"\1" + block + r"\2", t, count=1) + if n != 1: + raise SystemExit(f"could not insert landing-rev in {path}") + t = t2 +open(path, "w", encoding="utf-8").write(t) +print(f"stamp → {path}") +PY +done + +echo "OK landing v${version} → ${short} (${human})"