Skip to content

Commit ed8cd9d

Browse files
committed
chore: try build script update
1 parent 100e4c0 commit ed8cd9d

File tree

2 files changed

+20
-20
lines changed

2 files changed

+20
-20
lines changed

build.sh

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,29 @@ set -e
44

55
echo "🚩 ENABLE_TINA_ADMIN: $ENABLE_TINA_ADMIN"
66

7-
if [ "$ENABLE_TINA_ADMIN" = "true" ]; then
8-
echo "📦 Building Tina admin UI..."
9-
npx @tinacms/cli build
10-
11-
echo "🧼 Copying Tina admin to static/cms-admin..."
12-
# Use cms-admin instead of admin to avoid Docusaurus routing conflicts
13-
rm -rf static/cms-admin
14-
cp -r public/admin static/cms-admin
7+
if [[ "$ENABLE_TINA_ADMIN" == "true" ]]; then
8+
echo "📦 Building Tina admin UI…"
9+
npx @tinacms/cli build # produces public/admin
10+
11+
# ------------------------------------------
12+
# Copy Tina bundle into the final build dir
13+
# ------------------------------------------
14+
# DOCS_BASEURL may be "/", "/Docusaurus-docs/", etc.
15+
BASE="${DOCS_BASEURL:-/}"
16+
BASE="${BASE#/}" ; BASE="${BASE%/}" # strip leading/trailing /
17+
DEST="build"
18+
[[ -n "$BASE" ]] && DEST="$DEST/$BASE"
19+
DEST="$DEST/admin"
20+
21+
echo "🔀 Copying Tina → $DEST"
22+
rm -rf "$DEST"
23+
mkdir -p "$DEST"
24+
cp -a public/admin/. "$DEST/"
1525
else
16-
echo "⏭️ Skipping Tina admin build (ENABLE_TINA_ADMIN is not true)"
26+
echo "⏭️ Tina admin build skipped"
1727
fi
1828

29+
1930
# Ensure sidebar index exists
2031
if [ ! -f "src/sidebars/index.json" ]; then
2132
echo '{"items": []}' > src/sidebars/index.json

src/pages/admin/index.tsx

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)