From bb93e8d7c0a37a38d80b75d55117a75aa53e1de1 Mon Sep 17 00:00:00 2001 From: St33v Date: Sun, 1 Feb 2026 14:53:04 +1100 Subject: robots / sitemap demo version --- forge/script/gen-robots-sitemap.sh | 48 +++++++++++++++++++++++++++++++++++ forge/script/rsyncGlitch.txt | 51 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 99 insertions(+) create mode 100755 forge/script/gen-robots-sitemap.sh create mode 100644 forge/script/rsyncGlitch.txt (limited to 'forge') diff --git a/forge/script/gen-robots-sitemap.sh b/forge/script/gen-robots-sitemap.sh new file mode 100755 index 0000000..30dbdea --- /dev/null +++ b/forge/script/gen-robots-sitemap.sh @@ -0,0 +1,48 @@ +#!/usr/bin/env bash +set -euo pipefail + +OUT_DIR="${1:-.faircamp_build}" +SITE_URL="${2:-https://st33v.com}" + +cd "$OUT_DIR" + +# --- robots.txt --- +cat > robots.txt < "$tmp" + +{ + printf '%s\n' '' + printf '%s\n' '' + while IFS=$'\t' read -r path lastmod; do + # Escape ampersands minimally + url="${SITE_URL%/}/$(printf '%s' "$path" | sed 's/&/\&/g')" + printf ' %s%s\n' "$url" "$lastmod" + done < "$tmp" + printf '%s\n' '' +} > sitemap.xml + +rm -f "$tmp" + +echo "Wrote: $OUT_DIR/robots.txt" +echo "Wrote: $OUT_DIR/sitemap.xml" + diff --git a/forge/script/rsyncGlitch.txt b/forge/script/rsyncGlitch.txt new file mode 100644 index 0000000..0b3142b --- /dev/null +++ b/forge/script/rsyncGlitch.txt @@ -0,0 +1,51 @@ +This is background for gpt. +Here I explain th details of the static site generation schema for st33v.com. + +Brifely, the site is built from two 'faircamp's: + one for the main site and + song of the day (sotd), which lives in st33v.com/sotd (i.e thats its base url) + +detail: +st33v@cr4y:~/dox/st33v.com$ tree -La 2 +. +├── faircamp +│   ├── campsite.png +│   ├── catalog.eno +│   ├── deploy.sh +│   ├── drMorbius +│   ├── eli +│   ├── .faircamp_build +│   ├── .faircamp_cache +│   ├── robots.txt +│   └── st33vTM +├── forge +│   ├── automationUseCase.txt +│   ├── in +│   ├── out +│   ├── script +│   └── template +├── .git +│   └─[redacted for clarity] +└── sotd + ├── 2016-01-29-pluto + ├── 2026-01-29-devonian-dunkleosteus + ├── 2026-01-30-grouse + ├── 2026-01-30-llmtm + ├── catalog.eno + ├── .faircamp_build + ├── .faircamp_cache + └── sotd_cover.png + +The two static site are held in the two .faircamp_build directories + +rsync copies their contents to st33.com and st33v.com/sotd, respectively. + +BUT the base site know nothing of sotd, so the --delete directive deletes all of sotd. +This is not what we want. + +Question: How can we protect sotd from the ravages of rsync? + +There is also a second question around the robots & sitemap generator. Are we allowed to have a robots.txt & sitemap.xml in sot as well? + +Or is there a more elegant way to include the entire /sotd path in th first script? + -- cgit v1.3