mirror of
https://github.com/tiennm99/HugoBlox-kit.git
synced 2026-10-05 16:13:52 +00:00
Refactored from legacy layouts/partials/blox/* system to:
- blox/<block-id>/block.html source structure
- Hugo module mounts to layouts/partials/hbx/blocks/<block-id>/block.html
- Resolver-based lookup
- Support for data-driven pages and client islands
50 lines
1.2 KiB
Bash
Executable File
50 lines
1.2 KiB
Bash
Executable File
#!/usr/bin/env zsh
|
|
|
|
exitfn () {
|
|
trap SIGINT
|
|
cd "$INITIAL_DIR"
|
|
exit
|
|
}
|
|
|
|
trap "exitfn" INT
|
|
|
|
usage() {
|
|
echo "View a starter template with published production modules."
|
|
echo ""
|
|
echo "Usage: ./scripts/view-starter-prod.sh <starter-name>"
|
|
echo "Example: ./scripts/view-starter-prod.sh blog"
|
|
echo ""
|
|
echo "This script uses:"
|
|
echo " • Published/released modules (no local overrides)"
|
|
echo " • Production environment (simulates end-user experience)"
|
|
echo " • Minimal configuration for testing published versions"
|
|
}
|
|
|
|
if [ -z "$1" ]; then
|
|
usage
|
|
exit 1
|
|
fi
|
|
|
|
INITIAL_DIR=$(pwd)
|
|
|
|
# Run Hugo from the starter directory so Tailwind v4 CLI is discoverable by Hugo
|
|
cd "starters/$1"
|
|
|
|
# Ensure Tailwind CLI is available for Hugo
|
|
if [ -f "package.json" ]; then
|
|
if [ ! -x "node_modules/.bin/tailwindcss" ]; then
|
|
echo "📦 Installing Tailwind CLI in starter directory for Hugo..."
|
|
if command -v pnpm >/dev/null 2>&1; then
|
|
pnpm install
|
|
else
|
|
npm install
|
|
fi
|
|
fi
|
|
fi
|
|
|
|
# Use production environment with published modules (no local module replacements)
|
|
HUGO_ENVIRONMENT=production \
|
|
hugo server --panicOnWarning --renderStaticToDisk -F --port 8081 --bind 0.0.0.0
|
|
|
|
trap SIGINT
|