Migrate to Chi router and add Norwegian Devigo demo

Major improvements:
- Replace Gorilla Mux with Chi v5 router for better performance and cleaner code
- Fix CSS/JS MIME type issues that prevented proper asset loading
- Add built-in CORS middleware replacing manual OPTIONS handlers
- Simplify routing with nested route syntax
- Update URL parameter extraction from mux.Vars to chi.URLParam

New Devigo demo:
- Add production Norwegian sales training website (devigo.no)
- Real-world Hugo-generated content with TailwindCSS
- 39 insertr-enhanced elements for comprehensive CMS testing
- Demonstrates international language support and B2B use cases
- Fixed asset paths for localhost serving compatibility

Technical benefits:
- Automatic MIME type detection for static files
- Reduced code complexity with built-in middleware
- Better performance with lighter dependency stack
- Production-ready CORS handling
This commit is contained in:
2025-09-17 13:34:36 +02:00
parent 12c6ec8048
commit cd202ebb1d
87 changed files with 7737 additions and 71 deletions

View File

@@ -40,9 +40,10 @@ dev: build-lib build
echo ""
echo "🌐 All sites available at:"
echo " Default site: http://localhost:8080/sites/default/"
echo " Simple site: http://localhost:8080/sites/simple/"
echo " Dan Eden site: http://localhost:8080/sites/dan-eden-portfolio/"
echo " Default: http://localhost:8080/sites/default/"
echo " Simple: http://localhost:8080/sites/simple/"
echo " Dan Eden: http://localhost:8080/sites/dan-eden-portfolio/"
echo " Devigo (NO): http://localhost:8080/sites/devigo-web/"
echo ""
echo "📝 Full-stack ready - edit content with real-time persistence!"
echo "🔄 Press Ctrl+C to shutdown"
@@ -62,15 +63,7 @@ dev-about: build-lib build
check:
npm run check
# Simple demo launcher - all sites now served from main server
demo:
@echo "🌐 All demo sites are served from the main server:"
@echo " http://localhost:8080/sites/default/ - Main demo site"
@echo " http://localhost:8080/sites/simple/ - Simple test site"
@echo " http://localhost:8080/sites/dan-eden-portfolio/ - Dan Eden portfolio"
@echo ""
@echo "🚀 To start the development server:"
@echo " just dev"
# Build the entire project (library + unified binary)
build:
@@ -100,7 +93,9 @@ help:
# Enhance demo site (build-time content injection)
enhance input="demos/default" output="dist":
./insertr enhance {{input}} --output {{output}} --mock
./insertr enhance {{input}} --output {{output}}
# === Content API Server Commands ===
@@ -157,12 +152,11 @@ status:
@ls -la lib/package.json lib/src lib/dist 2>/dev/null || echo " Missing library components"
@echo "\n🔧 Unified binary:"
@ls -la insertr main.go cmd/ internal/ 2>/dev/null || echo " Missing unified binary components"
@echo "\n🌐 Demo site:"
@ls -la demos/demo-site/index.html demos/demo-site/about.html 2>/dev/null || echo " Missing demo files"
@echo "\n🌐 Demo sites:"
@ls -la demos/default/index.html demos/simple/index.html demos/dan-eden-portfolio/index.html demos/devigo-web/index.html 2>/dev/null || echo " Some demo files missing"
@echo ""
@echo "🚀 Development Commands:"
@echo " just dev - Full-stack development (recommended)"
@echo " just demo - Show available demo sites"
@echo " just serve - API server only (localhost:8080)"
@echo " just enhance - Build-time content injection"
@echo ""
@@ -201,6 +195,11 @@ clean-demos:
echo "🗑️ Removed: dan-eden-portfolio_enhanced"
fi
if [ -d "./demos/devigo-web_enhanced" ]; then
rm -rf "./demos/devigo-web_enhanced"
echo "🗑️ Removed: devigo-web_enhanced"
fi
# Clean up any temporary directories
if [ -d "./demos/dan-eden-portfolio-temp" ]; then
rm -rf "./demos/dan-eden-portfolio-temp"