feat: implement server-hosted static site enhancement with real-time content updates
- Add SiteManager for registering and managing static sites with file-based enhancement - Implement EnhanceInPlace method for in-place file modification using database content - Integrate automatic file enhancement triggers in UpdateContent API handler - Add comprehensive site configuration support in insertr.yaml with auto-enhancement - Extend serve command to automatically register and manage configured sites - Add backup system for original files before enhancement - Support multi-site hosting with individual auto-enhancement settings - Update documentation for server-hosted enhancement workflow This enables real-time content deployment where database content changes immediately update static files without requiring rebuilds or redeployment. The database remains the single source of truth while maintaining static file performance benefits.
This commit is contained in:
15
COMMANDS.md
15
COMMANDS.md
@@ -65,7 +65,7 @@ insertr enhance [input-dir] [flags]
|
||||
|
||||
## 🔌 serve Command
|
||||
|
||||
Runtime API server - provides HTTP endpoints for content management.
|
||||
Runtime API server - provides HTTP endpoints for content management and server-hosted static site enhancement.
|
||||
|
||||
```bash
|
||||
insertr serve [flags]
|
||||
@@ -96,6 +96,19 @@ insertr serve [flags]
|
||||
./insertr --config production.yaml serve
|
||||
```
|
||||
|
||||
### Server-Hosted Static Sites
|
||||
|
||||
When running `insertr serve`, the server automatically:
|
||||
- **Registers sites** from `insertr.yaml` configuration
|
||||
- **Enhances static files** with latest database content
|
||||
- **Auto-updates files** when content changes via API
|
||||
- **Creates backups** of original files (if enabled)
|
||||
|
||||
**Live Enhancement Process:**
|
||||
1. Content updated via API → Database updated
|
||||
2. If site has `auto_enhance: true` → File enhancement triggered
|
||||
3. Static files updated in-place → Changes immediately live
|
||||
|
||||
### API Endpoints
|
||||
|
||||
When running `insertr serve`, these endpoints are available:
|
||||
|
||||
Reference in New Issue
Block a user