landing: content version stamp v42 with commit link
Footer on bank/exchange/merchant shows Landing vN, last content change time, and a linkified git commit. Start at v42; bump with scripts/taler-landing/stamp-landing-version.sh --bump.
This commit is contained in:
parent
fb1a0b0b8e
commit
33749ed714
5 changed files with 206 additions and 3 deletions
|
|
@ -1102,6 +1102,16 @@
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
}
|
}
|
||||||
.shop-foot a:hover { filter: brightness(1.06); }
|
.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; }
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
<base href="/intro/" />
|
<base href="/intro/" />
|
||||||
<link rel="stylesheet" href="/intro/shop-pay.css" />
|
<link rel="stylesheet" href="/intro/shop-pay.css" />
|
||||||
|
|
@ -1545,6 +1555,13 @@ tw run-until-done && tw balance</pre>
|
||||||
Privacy: processing under Swiss FADP (revDSG). What is retained is listed on
|
Privacy: processing under Swiss FADP (revDSG). What is retained is listed on
|
||||||
<a href="https://bank.hacktivism.ch/privacy" style="color:#5eead4">/privacy</a>.
|
<a href="https://bank.hacktivism.ch/privacy" style="color:#5eead4">/privacy</a>.
|
||||||
</p>
|
</p>
|
||||||
|
<!-- landing-rev -->
|
||||||
|
<p class="landing-rev" data-landing-version="42" data-landing-commit="aa3c23b">
|
||||||
|
Landing <strong>v42</strong>
|
||||||
|
· content <time datetime="2026-07-17T13:31:56+02:00">2026-07-17 13:31 CEST</time>
|
||||||
|
· <a href="https://git.hacktivism.ch/hernani/koopa-admin-log/commit/aa3c23be49236ba5c20cd095bb02790f84aeb1e5" title="koopa-admin-log aa3c23be49236ba5c20cd095bb02790f84aeb1e5">aa3c23b</a>
|
||||||
|
</p>
|
||||||
|
<!-- /landing-rev -->
|
||||||
</footer>
|
</footer>
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -274,6 +274,16 @@
|
||||||
footer { margin-top: 1.75rem; text-align: center; color: var(--muted); font-size: 0.85rem; }
|
footer { margin-top: 1.75rem; text-align: center; color: var(--muted); font-size: 0.85rem; }
|
||||||
footer a { color: #e8c878; }
|
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; }
|
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; }
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
@ -479,6 +489,13 @@ sudo apt-get install -y taler-wallet-cli</pre>
|
||||||
Privacy: processing under Swiss FADP (revDSG). What is retained is listed on
|
Privacy: processing under Swiss FADP (revDSG). What is retained is listed on
|
||||||
<a href="https://exchange.hacktivism.ch/privacy" style="color:#5eead4">/privacy</a>.
|
<a href="https://exchange.hacktivism.ch/privacy" style="color:#5eead4">/privacy</a>.
|
||||||
</p>
|
</p>
|
||||||
|
<!-- landing-rev -->
|
||||||
|
<p class="landing-rev" data-landing-version="42" data-landing-commit="aa3c23b">
|
||||||
|
Landing <strong>v42</strong>
|
||||||
|
· content <time datetime="2026-07-17T13:31:56+02:00">2026-07-17 13:31 CEST</time>
|
||||||
|
· <a href="https://git.hacktivism.ch/hernani/koopa-admin-log/commit/aa3c23be49236ba5c20cd095bb02790f84aeb1e5" title="koopa-admin-log aa3c23be49236ba5c20cd095bb02790f84aeb1e5">aa3c23b</a>
|
||||||
|
</p>
|
||||||
|
<!-- /landing-rev -->
|
||||||
</footer>
|
</footer>
|
||||||
</main>
|
</main>
|
||||||
<script src="/intro/goa-amount.js"></script>
|
<script src="/intro/goa-amount.js"></script>
|
||||||
|
|
|
||||||
|
|
@ -517,6 +517,16 @@
|
||||||
.sym-gold path[data-ring], .sym-gold circle[data-ring] { fill: none; stroke: #f0c86a; }
|
.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, .sym-blue circle { fill: #3ecfbf; stroke: #3ecfbf; }
|
||||||
.sym-blue path[data-ring], .sym-blue circle[data-ring] { fill: none; 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; }
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
@ -822,6 +832,13 @@ sudo apt-get install -y taler-wallet-cli</pre>
|
||||||
Privacy: processing under Swiss FADP (revDSG). What is retained is listed on
|
Privacy: processing under Swiss FADP (revDSG). What is retained is listed on
|
||||||
<a href="https://taler.hacktivism.ch/privacy" style="color:#5eead4">/privacy</a>.
|
<a href="https://taler.hacktivism.ch/privacy" style="color:#5eead4">/privacy</a>.
|
||||||
</p>
|
</p>
|
||||||
|
<!-- landing-rev -->
|
||||||
|
<p class="landing-rev" data-landing-version="42" data-landing-commit="aa3c23b">
|
||||||
|
Landing <strong>v42</strong>
|
||||||
|
· content <time datetime="2026-07-17T13:31:56+02:00">2026-07-17 13:31 CEST</time>
|
||||||
|
· <a href="https://git.hacktivism.ch/hernani/koopa-admin-log/commit/aa3c23be49236ba5c20cd095bb02790f84aeb1e5" title="koopa-admin-log aa3c23be49236ba5c20cd095bb02790f84aeb1e5">aa3c23b</a>
|
||||||
|
</p>
|
||||||
|
<!-- /landing-rev -->
|
||||||
</footer>
|
</footer>
|
||||||
</main>
|
</main>
|
||||||
<script src="/intro/goa-amount.js"></script>
|
<script src="/intro/goa-amount.js"></script>
|
||||||
|
|
|
||||||
9
configs/shared/landing-version.json
Normal file
9
configs/shared/landing-version.json
Normal file
|
|
@ -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."
|
||||||
|
}
|
||||||
143
scripts/taler-landing/stamp-landing-version.sh
Executable file
143
scripts/taler-landing/stamp-landing-version.sh
Executable file
|
|
@ -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 <<EOF
|
||||||
|
<!-- landing-rev -->
|
||||||
|
<p class="landing-rev" data-landing-version="${version}" data-landing-commit="${short}">
|
||||||
|
Landing <strong>v${version}</strong>
|
||||||
|
· content <time datetime="${iso}">${human}</time>
|
||||||
|
· <a href="${url}" title="koopa-admin-log ${full}">${short}</a>
|
||||||
|
</p>
|
||||||
|
<!-- /landing-rev -->
|
||||||
|
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 </style> 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("</style>")
|
||||||
|
if idx < 0:
|
||||||
|
raise SystemExit(f"no </style> 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 </footer>
|
||||||
|
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]*<!-- landing-rev -->.*?<!-- /landing-rev -->\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]*</footer>)", 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})"
|
||||||
Loading…
Add table
Add a link
Reference in a new issue