Manual rebuild hook + polish: single title h1, '›' tree marker
- deploy/rebuild-hook.py: tiny stdlib HTTP service (:18101) — button page for the Homepage dashboard iframe, POST /rebuild runs auto-build.sh --force, /status + /healthz for feedback/monitoring - auto-build.sh: --force flag + flock so timer and manual builds serialize - [...slug].astro: skip the synthetic h1 when the note body already opens with an identical h1 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
+11
-1
@@ -1,13 +1,23 @@
|
||||
#!/bin/sh
|
||||
# Timer target: rebuild the garden only when the vault or repo changed.
|
||||
# Successor to the Quartz update_quartz_docker.sh change-detection loop.
|
||||
# Usage: auto-build.sh [--force] (--force skips change detection — used
|
||||
# by the manual rebuild hook)
|
||||
set -eu
|
||||
|
||||
REPO=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd)
|
||||
VAULT="${VAULT:-/home/nox/docker/obsidian/vaults/weeslahw_coppermind}"
|
||||
STATE="$REPO/.build_state"
|
||||
FORCE=0
|
||||
[ "${1:-}" = "--force" ] && FORCE=1
|
||||
|
||||
cd "$REPO"
|
||||
|
||||
# serialize builds: the 5-min timer and the manual hook must never run
|
||||
# docker/npm into the same checkout concurrently
|
||||
exec 9>"$REPO/.build.lock"
|
||||
flock 9
|
||||
|
||||
# a dirty tree can make pull fail; still rebuild whatever is checked out
|
||||
git pull -q || echo "git pull failed (dirty tree?) — building local state"
|
||||
|
||||
@@ -19,7 +29,7 @@ sig=$({
|
||||
find "$VAULT" -name .obsidian -prune -o -type f -printf '%T@ %p\n' | sort
|
||||
} | sha256sum | cut -d' ' -f1)
|
||||
|
||||
if [ -f "$STATE" ] && [ "$(cat "$STATE")" = "$sig" ]; then
|
||||
if [ "$FORCE" -eq 0 ] && [ -f "$STATE" ] && [ "$(cat "$STATE")" = "$sig" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user