Files
cnx_vinyl/site/build.sh
T
grabowski a07faf6ef0
Deploy test site / deploy (push) Successful in 53s
Artist ordering demo: configure, check, offer, fan-funded campaign
New static page docs/artist-order.html (test site /demos/artist-order/)
walking the artist platform flow end to end:

- record configurator (format, speed, discs, weight, colour, packaging,
  extras, mastering, test pressings) with a live mock-up
- track list or dropped masters read in the browser (WAV/FLAC/AIFF
  headers, sample peak and clipping), side length against the format,
  jacket and label preflight (size, dpi, CMYK), rights and gate 1
- itemised offer (per title / per copy, pass-through jacket), price per
  copy against quantity, lead time from the production timeline
- direct order or fan-funded campaign: goal = max(minimum run,
  break-even), what the artist keeps, the money rules, a simulated
  campaign (sells out / just makes it / falls short) with refund or
  go-ahead-at-minimum, and the production tracker with the three gates
  and the fan update feed

Price list demo-0.1 splits the doc's 38,000 THB per title and 132 THB per
copy into lines (estimates, each listed with its basis); defaults
reproduce the artist platform example (break-even 41, goal 100, ~548 THB
kept per copy at 100).

artist-platform.md: demo paragraph, side length per format table with
sources, VAT note on the campaign example. README bullet and layout line,
site DEMOS line and landing-page entry.
2026-10-14 19:24:49 +07:00

61 lines
2.0 KiB
Bash

#!/usr/bin/env bash
# Assemble the cnxvinyl.lol web root in site/dist.
#
# site/public/ copied verbatim: landing page, robots.txt, and any static
# site dropped in as its own directory (site/public/<name>/)
# DEMOS below pages copied out of docs/, so docs/ stays their one source
#
# Run locally with `bash site/build.sh`, then open site/dist/index.html.
# CI (.gitea/workflows/deploy-site.yml) runs the same script and deploys
# site/dist as it is.
set -euo pipefail
cd "$(dirname "$0")/.."
out=site/dist
rm -rf "$out"
mkdir -p "$out"
cp -R site/public/. "$out/"
# "<source in the repo> <path under the web root>"
DEMOS=(
"docs/plant-operation.html demos/plant-operation/index.html"
"docs/fleet-calculator.html demos/fleet-calculator/index.html"
"docs/steam-cooling.html demos/steam-cooling/index.html"
"docs/artist-order.html demos/artist-order/index.html"
)
for entry in "${DEMOS[@]}"; do
read -r src dst <<<"$entry"
mkdir -p "$out/$(dirname "$dst")"
cp "$src" "$out/$dst"
done
# The deploy job reads this back from the server to confirm what is live.
git rev-parse HEAD >"$out/version.txt" 2>/dev/null || echo unknown >"$out/version.txt"
# Fail on a dead internal link: every href/src in every page that points
# inside the site must resolve to a file in dist.
dead=0
while IFS= read -r page; do
dir=$(dirname "$page")
while IFS= read -r ref; do
# shellcheck disable=SC2016 # literal ${ and {{ mark JS/template strings
case "$ref" in
'' | '#'* | http:* | https:* | mailto:* | tel:* | data:* | javascript:* | *'${'* | *'{{'*) continue ;;
esac
ref=${ref%%#*}
ref=${ref%%\?*}
case "$ref" in
/*) target="$out$ref" ;;
*) target="$dir/$ref" ;;
esac
[ -d "$target" ] && target="${target%/}/index.html"
if [ ! -f "$target" ]; then
echo "dead link in ${page#"$out"/}: $ref" >&2
dead=1
fi
done < <(grep -o -E '(href|src)="[^"]*"' "$page" | sed -E 's/^(href|src)="//; s/"$//')
done < <(find "$out" -name '*.html')
[ "$dead" -eq 0 ] || exit 1
echo "built $out: $(find "$out" -type f | wc -l | tr -d ' ') files"