Files
cnx_vinyl/site/build.sh
T
grabowski c6bec71442
Deploy test site / deploy (push) Successful in 37s
Press fleet calculator: target output and specials share to fleet mix and needs
User, October 2026: calculations for the later business plan, starting
from 2 Duplex + 1 Classic at 3 records a minute per Duplex and 2 per
Classic, as an interactive tool on the website: pick the yearly output
and the share of splatter/specials, get the machine mix and all the
requirements (people, hydraulics, power, ...).

docs/fleet-calculator.html (single static page, no dependencies):
- target mode sizes the fleet (specials only on Duplex with its EX 35;
  grow with Classics or with Duplex systems; start fleet as the floor);
  fleet mode takes a fleet and gives its output at the specials share;
- output, capacity, utilisation and the mix bar per machine type;
- needs: people per shift and in total, galvanics operators, machines,
  connected kVA and average kW, MWh/yr, central hydraulics (flow, motor,
  oil, accumulator), steam, cooling and cooling water, compressed air,
  press floor, room climate, compound, trim, titles, electroformed parts
  and plating units; checks against the 400 kg/h boiler, 250 kW chiller
  and the 870 m2 Payap press hall;
- ladder from the start fleet to a full Payap press hall, click to load;
- every assumption editable with its source (Newbilt Duplex site
  requirements V14 and offer 240620-04, scale.md, galvanics.md, revenue
  model, Payap model; estimates labelled), shareable link via the hash.
The Classic counts as one HRP 12 press plus one extruder until Newbilt
states figures (Toolex Alpha leaflet as a cross-check).

Site: DEMOS entry (/demos/fleet-calculator/) and landing-page entry.
README bullet and layout line; backlinks from scale.md (capacity) and
pressing-line.md (current plan).
2026-10-10 18:21:47 +07:00

59 lines
1.9 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"
)
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"