Fix demo site auto-enhancement and content persistence

- Restructure demo directory from test-sites/ to demos/ with flattened layout
- Add auto-enhancement on server startup for all sites with auto_enhance: true
- Fix inconsistent content ID generation that prevented dan-eden-portfolio content persistence
- Update server configuration to enhance from source to separate output directories
- Remove manual enhancement from justfile in favor of automatic server enhancement
- Clean up legacy test files and unused restore command
- Update build system to use CDN endpoint instead of file copying
This commit is contained in:
2025-09-17 00:07:40 +02:00
parent 1fa607c47c
commit 71561316da
73 changed files with 190 additions and 4827 deletions

19
demos/simple/index.html Normal file
View File

@@ -0,0 +1,19 @@
<!DOCTYPE html><html><head>
<title>Simple Test</title>
<script src="http://localhost:8080/insertr.js" data-insertr-injected="true" data-site-id="simple" data-api-endpoint="http://localhost:8080/api/content" data-mock-auth="true" data-debug="true"></script></head>
<body>
<h1 class="insertr" data-content-id="index-h1-e0f926" data-content-type="text">Welcome, you!!</h1>
<p class="insertr" data-content-id="index-p-b376ed" data-content-type="markdown">This is a <strong>test</strong> paragraph with <a href="/">a link</a>.</p>
<div>
<h2 class="insertr" data-content-id="index-h2-d8622b" data-content-type="text">Section Title</h2>
<p class="insertr" data-content-id="index-p-2-daa8f5" data-content-type="markdown">Another paragraph here.</p>
<button class="insertr" data-content-id="index-button-41ef19" data-content-type="link">Click Me</button>
</div>
<div class="insertr-demo-gate" style="position: fixed; top: 20px; right: 20px; z-index: 9999; font-family: -apple-system, BlinkMacSystemFont, &#39;Segoe UI&#39;, Roboto, sans-serif;">
<button class="insertr-gate insertr-demo-gate-btn insertr" style="background: #4f46e5; color: white; border: none; padding: 10px 16px; border-radius: 8px; font-size: 14px; font-weight: 500; cursor: pointer; box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3); transition: all 0.2s ease; display: flex; align-items: center; gap: 8px; user-select: none;" onmouseover="this.style.background=&#39;#4338ca&#39;; this.style.transform=&#39;translateY(-2px)&#39;; this.style.boxShadow=&#39;0 6px 16px rgba(79, 70, 229, 0.4)&#39;" onmouseout="this.style.background=&#39;#4f46e5&#39;; this.style.transform=&#39;translateY(0)&#39;; this.style.boxShadow=&#39;0 4px 12px rgba(79, 70, 229, 0.3)&#39;" data-content-id="index-insertr-gate-61c9aa" data-content-type="link">
<span style="font-size: 16px;">✏️</span>
<span>Edit Site</span>
</button>
</div></body></html>

27
demos/simple/insertr.yaml Normal file
View File

@@ -0,0 +1,27 @@
# Insertr Configuration for Simple Demo Site
# Specific configuration for the simple test site demo
# Global settings
dev_mode: true # Development mode for demos
# Database configuration
database:
path: "./insertr.db" # Shared database with main config
# Demo-specific configuration
demo:
site_id: "simple" # Unique site ID for simple demo
inject_demo_gate: true # Auto-inject demo gate if no gates exist
mock_auth: true # Use mock authentication for demos
api_endpoint: "http://localhost:8080/api/content"
demo_port: 3000 # Port for live-server
# CLI enhancement configuration
cli:
site_id: "simple" # Site ID for this demo
output: "./demos/simple_enhanced" # Output directory for enhanced files
inject_demo_gate: true # Inject demo gate in development mode
# Authentication configuration (for demo)
auth:
provider: "mock" # Mock auth for demos