Skip to content

Commit 3b12b36

Browse files
committed
fix: logic
1 parent 5866a8e commit 3b12b36

File tree

1 file changed

+12
-14
lines changed

1 file changed

+12
-14
lines changed

build.sh

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,42 @@
11
#!/usr/bin/env bash
2-
set -e
2+
set -euo pipefail
33

44
echo "▶ ENABLE_TINA_ADMIN = ${ENABLE_TINA_ADMIN:-false}"
55
echo "▶ DOCS_BASEURL = ${DOCS_BASEURL:-/}"
66

77
#───────────────────────────────────────────────────────────────#
8-
# 1. Build Tina -> public/admin
8+
# 1. Build Tina → static/admin (handled by publicFolder=static)
99
#───────────────────────────────────────────────────────────────#
1010
if [[ "${ENABLE_TINA_ADMIN:-}" == "true" ]]; then
1111
echo "📦 Building TinaCMS admin …"
1212
npx tinacms build
1313
fi
1414

15-
# Ensure sidebar index exists
16-
if [ ! -f "src/sidebars/index.json" ]; then
15+
#───────────────────────────────────────────────────────────────#
16+
# 2. Ensure an empty sidebar index exists (first-time clone)
17+
#───────────────────────────────────────────────────────────────#
18+
if [[ ! -f "src/sidebars/index.json" ]]; then
1719
echo '{"items": []}' > src/sidebars/index.json
1820
fi
1921

20-
# Copy Tina admin to Docusaurus static folder
21-
rm -rf static/admin
22-
cp -r public/admin static/admin
23-
22+
#───────────────────────────────────────────────────────────────#
23+
# 3. Inline every pre-built Reveal.js deck into static/decks/…
24+
#───────────────────────────────────────────────────────────────#
2425
PROJECT_ROOT="$(pwd)"
2526
SRC_DIR="$PROJECT_ROOT/src/decks/prebuilds"
2627
OUT_DIR="$PROJECT_ROOT/static/decks"
2728

28-
echo "📦 Inlining Reveal.js HTML decks..."
29-
29+
echo "📦 Inlining Reveal.js HTML decks…"
3030
find "$SRC_DIR" -name 'index.html' | while read -r html; do
3131
rel_path="${html#$SRC_DIR/}"
3232
out_path="$OUT_DIR/$rel_path"
3333
out_dir="$(dirname "$out_path")"
3434

3535
mkdir -p "$out_dir"
36-
3736
echo "✨ Inlining: $rel_path"
3837
npx html-inline --nocompress --inlinemin --root "$PROJECT_ROOT" "$html" > "$out_path"
3938
done
40-
4139
echo "✅ All slide decks inlined to: $OUT_DIR"
4240

43-
echo "🛠️ Building Docusaurus site..."
44-
npm run build
41+
echo "🛠️ Pre-build tasks complete; Docusaurus build will run next."
42+
# (The outer npm script runs `docusaurus build` — do **not** call it again here.)

0 commit comments

Comments
 (0)