This repository has no description
2.2 kB
46 lines
1#!/usr/bin/env bash
2set -euo pipefail
3
4HTMX_URL="https://cdn.jsdelivr.net/npm/htmx.org@2.0.10/dist/htmx.min.js"
5HTMX_WS_URL="https://cdn.jsdelivr.net/npm/htmx-ext-ws@2.0.4"
6MERMAID_URL="https://cdn.jsdelivr.net/npm/mermaid@11.12.3/dist/mermaid.min.js"
7MATHJAX_URL="https://cdn.jsdelivr.net/npm/mathjax@4.1.2/tex-svg.js"
8LUCIDE_URL="https://github.com/lucide-icons/lucide/releases/download/0.536.0/lucide-icons-0.536.0.zip"
9INTER_URL="https://github.com/rsms/inter/releases/download/v4.1/Inter-4.1.zip"
10PLEX_MONO_URL="https://github.com/IBM/plex/releases/download/%40ibm%2Fplex-mono%401.1.0/ibm-plex-mono.zip"
11ACTOR_TYPEAHEAD_REPO="https://tangled.org/@jakelazaroff.com/actor-typeahead"
12
13REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
14OUT="$REPO_ROOT/appview/pages/static"
15TMP="$(mktemp -d)"
16# trap 'rm -rf "$TMP"' EXIT
17
18mkdir -p "$OUT"/{fonts,icons,logos}
19
20curl -fsSL -o "$OUT/htmx.min.js" "$HTMX_URL"
21curl -fsSL -o "$OUT/htmx-ext-ws.min.js" "$HTMX_WS_URL"
22curl -fsSL -o "$OUT/mermaid.min.js" "$MERMAID_URL"
23curl -fsSL -o "$OUT/mathjax.min.js" "$MATHJAX_URL"
24
25curl -fsSL -o "$TMP/lucide.zip" "$LUCIDE_URL"
26unzip -q "$TMP/lucide.zip" -d "$TMP/lucide"
27cp -rf "$TMP"/lucide/icons/*.svg "$OUT/icons/"
28
29curl -fsSL -o "$TMP/inter.zip" "$INTER_URL"
30unzip -q "$TMP/inter.zip" -d "$TMP/inter"
31cp -f "$TMP"/inter/web/InterVariable*.woff2 "$OUT/fonts/"
32cp -f "$TMP"/inter/web/InterDisplay*.woff2 "$OUT/fonts/"
33cp -f "$TMP"/inter/InterVariable*.ttf "$OUT/fonts/"
34
35curl -fsSL -o "$TMP/plex.zip" "$PLEX_MONO_URL"
36unzip -q "$TMP/plex.zip" -d "$TMP/plex"
37cp -f "$TMP"/plex/ibm-plex-mono/fonts/complete/woff2/IBMPlexMono*.woff2 "$OUT/fonts/"
38
39git clone --depth=1 "$ACTOR_TYPEAHEAD_REPO" "$TMP/actor-typeahead"
40cp -f "$TMP/actor-typeahead/actor-typeahead.js" "$OUT/"
41
42(cd "$REPO_ROOT" && go build -o "$TMP/dolly" ./cmd/dolly)
43TEMPLATE="$REPO_ROOT/appview/pages/templates/fragments/dolly"
44"$TMP/dolly" -template "$TEMPLATE" -output "$OUT/logos/dolly.png" -size 180
45"$TMP/dolly" -template "$TEMPLATE" -output "$OUT/logos/dolly.ico" -size 48
46"$TMP/dolly" -template "$TEMPLATE" -output "$OUT/logos/dolly.svg" -color currentColor -favicon