Files
HugoBlox-kit/scripts/view-starter-prod.sh
T
George Cushen e6734f33ae feat(scripts): default to academic-cv starter when no argument provided
- 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
2025-09-17 00:16:19 +01:00

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