Deploy test site / deploy (push) Successful in 53s
New static page docs/make-a-record.html (test site /demos/make-a-record/): the artist platform as a customer would see it, polished for presenting. - five steps (design, music and art, price, fan funding, track) with a sticky stage: to-scale mock-up (record spins at 33 1/3 or 45 rpm on hover), spec chips, price per copy, ship month and the next action - design as option cards and swatches; options that do not apply stay visible and disabled (weight and gatefold off 12", colour pickers for black vinyl) - masters and artwork read in the browser as in the detailed demo, side bars per side, checks in plain words, approval 1 of 3 - price with the curve, itemised lines folded under one summary, lead time as two bars (approvals, then the 7 to 9 week quote) - fan funding: goal, break-even and what the artist keeps, money rules; the campaign on a phone with a pre-order ticker, funded or missed ends, production timeline with the artist's approvals, updates feed - record passport for one delivered copy (stamper, press, cycle time and side; stage dates; optical inspection and sampled audio), per traceability.md and quality-automation.md, IDs simulated; repress card - "Investor notes" switch with the business case per step (market research, vault, short-run economics and the Thai price gap, plant-owned vs broker and the Qrates lesson, traceability and represses); guided tour of about a minute (#tour, #notes in the URL) - light/dark theme shared with the other pages; phone layout with a bottom bar Same price list (demo-0.1) and stage table as artist-order.html, so the defaults reproduce the artist platform example: 37,836 THB per title, 232 THB per copy at 100, break-even 41, goal 100, 548 THB kept a copy. artist-platform.md: investor demo paragraph. traceability.md: the record passport as the per-copy customer view. README bullet and layout line, site DEMOS line and landing-page entry.
62 lines
2.1 KiB
Bash
62 lines
2.1 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"
|
|
"docs/make-a-record.html demos/make-a-record/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"
|