#!/usr/bin/env sh # Assemble the deployable site into ./site: what a static host needs (the page, its styles, dist/, pplus-core's # core/dist/ that the page's import map points at, and the Quarto extension). set -eu cd "$(dirname "$0")/.." rm -rf site && mkdir -p site cp -r index.html styles.css styles dist site/ rm -f site/styles/course/README.md # the provenance notes stay in the repository # pplus-core's built modules, without source maps, declarations, or the lesson corpus (a test fixture) mkdir -p site/core cp -r core/dist site/core/ find site/core/dist \( -name '*.map' -o -name '*.d.ts' \) -delete rm -rf site/core/dist/curriculum # the Quarto extension, which the "With Quarto" page loads (pplus.css, pplus.js) and links to, file by file mkdir -p site/quarto/_extensions cp -r quarto/_extensions/pplus site/quarto/_extensions/ rm -rf site/quarto/_extensions/pplus/engine printf '%s\n' "${GITHUB_SHA:-$(git rev-parse HEAD 2>/dev/null || echo dev)}" > site/VERSION echo "site/ assembled ($(du -sh site | cut -f1))"