#!/bin/sh # Assemble the whole website into build/www: # # / web/ the front page (this directory) # /docs/ contrib/gen-docs the rendered documentation # /demo/ web/demo/ the in-browser machine, on its own page # # web/build-site everything (or: make www) # NO_DEMO=1 web/build-site skip the demo (it cross-compiles a # guest and needs zig + e2fsprogs) # # The output is only static files. Serve it with anything that serves a # directory; the one condition is .wasm as application/wasm, which # `web/demo/serve --dir build/www` handles locally. set -eu here="$(cd "$(dirname "$0")" && pwd)" root="$(dirname "$here")" out="$root/build/www" rm -rf "$out" mkdir -p "$out" # For now slosh.foo is a coming-soon page; the full site is assembled only # when asked (FULL=1) while it is being finished. if [ "${FULL:-0}" != 1 ]; then cp "$here/coming-soon.html" "$out/index.html" echo "build-site: $out (coming soon -- FULL=1 for the real site)" exit 0 fi # The front page. cp "$here/index.html" "$here/site.css" "$here/install.sh" "$out/" cp "$here/slosh-preview.mp4" "$out/" # The docs, rendered by the same generator `make docs` uses. python3 "$root/contrib/gen-docs" "$out/docs" # The demo, assembled by its own Makefile, on its own page. if [ "${NO_DEMO:-0}" = 1 ]; then echo "build-site: skipping demo (NO_DEMO=1)" else make -C "$here/demo" site mkdir -p "$out/demo" cp -R "$here/demo/build/site/." "$out/demo/" fi echo "build-site: $out" echo "build-site: serve with: web/demo/serve --dir build/www"