Files
George Cushen 787ac94b5d feat: add Dev HUD & 15 Obsidian callouts; more collection filters
Dev tools
- Add HBX Dev HUD (floating button + panel) with live log viewer
- Add get-build-id helper to dedupe logs per build (during `hugo server` refreshes)

Callouts
- Implement Obsidian-compatible callouts (15+ types) with shared renderer
- Add i18n title translations (en, es, fr) for all callout types
- Deprecate `callout` shortcode with suppressible warning; keep working
- Migrate starters to Markdown callouts (>[!TYPE]) and update docs

Logging
- Centralize logging in partial `functions/logger` with info/warn/error levels
- Use fmt.Warnidf for suppressible warnings (consistent IDs)
- Only show info in Dev HUD/JSON (no longer use warnf for info logging); warn/error still printed in CLI
- Include source metadata and build ID on each entry

Blocks – Collection
- Add support for `content.filters.kinds`
- Add `content.filters.tags` (array) alongside existing `filters.tag` (string)

Build/Tailwind/JS
- Fix missing Tailwind v4 styles in Hugo render: include preact-built assets, extract classes from JSX/TSX to `@sources`
- Load Preact client per block, publish source maps in dev; on-demand Alpine

CI
- Re-implement fast fails with panicOnWarning now that info logging as warnf removed
- Fix package splitter change detection: strip trailing slashes; collapse paths to starter roots

Starters/Docs
- Restructure courses under `courses/hugo-blox/`
- Update menus and landing pages
- Replace deprecated callout usage in content and docs
- Replace missing hero icon `download` with `arrow-down-tray` in academic-cv guide

Icons
- Improve icon resolver: default pack inference, better fallback, and precise missing-icon warnings (with page ref)
2025-09-25 01:58:32 +01:00

101 lines
2.1 KiB
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
INITIAL_DIR="$(pwd)"
cleanup() {
cd "$INITIAL_DIR" || true
}
trap cleanup EXIT INT TERM
usage() {
echo "View the test site with local development modules."
echo ""
echo "Usage: ./scripts/view-test.sh [--debug]"
echo "Example: ./scripts/view-test.sh --debug"
echo ""
echo "This script uses:"
echo " • Local development modules (via go.mod replace directives)"
echo " • Development environment for testing"
}
DEBUG_MODE=false
while [ $# -gt 0 ]; do
case "$1" in
--)
# Skip the -- separator from pnpm
shift
;;
--debug)
DEBUG_MODE=true
shift
;;
-h|--help)
usage
exit 0
;;
-*)
echo "Unknown option: $1"
usage
exit 1
;;
*)
echo "Unexpected argument: $1"
usage
exit 1
;;
esac
done
# Run Hugo from the test dir
cd "test"
# Ensure dependencies are installed if needed
if [ -f "package.json" ] && [ ! -x "node_modules/.bin/tailwindcss" ]; then
echo "📦 Installing dependencies in test directory..."
if command -v pnpm >/dev/null 2>&1; then
pnpm install
else
npm install
fi
fi
# Core environment for local dev
export HUGO_ENVIRONMENT=development
export HUGO_BLOX_MONOREPO=true
export HUGO_BLOX_TEST_SITE=true
# Note: The test/go.mod already has replace directives for local modules,
# so we don't need HUGO_MODULE_REPLACEMENTS here
# Compose Hugo server args
HUGO_ARGS=(
server
--disableFastRender
--printI18nWarnings
--printPathWarnings
--gc
-F
--port 8082
--bind 0.0.0.0
)
if [ "$DEBUG_MODE" = true ]; then
HUGO_ARGS+=(
--panicOnWarning
--logLevel debug
--templateMetrics
--templateMetricsHints
--ignoreCache
--noHTTPCache
--renderStaticToDisk
-D
-E
)
fi
echo "🚀 Starting test site on http://localhost:8082"
hugo "${HUGO_ARGS[@]}"