mirror of
https://github.com/tiennm99/HugoBlox-kit.git
synced 2026-10-04 22:13:04 +00:00
- Update view-starter-dev.sh to default to academic-cv if no starter specified - Update view-starter-prod.sh to default to academic-cv if no starter specified - Update usage documentation to show starter name as optional parameter - Maintain backward compatibility with existing usage patterns
47 lines
1.4 KiB
Bash
Executable File
47 lines
1.4 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 "Default starter: academic-cv (if no starter-name provided)"
|
|
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"
|
|
}
|
|
|
|
STARTER="${1:-academic-cv}" # Default to academic-cv if no argument provided
|
|
INITIAL_DIR=$(pwd)
|
|
|
|
# Run Hugo from the starter directory so Tailwind v4 CLI is discoverable by Hugo
|
|
cd "starters/$STARTER"
|
|
|
|
# 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
|