- Introduced a new AI function `generate_page_content` to create structured content for website pages using JSON blocks. - Updated `AIEngine` to handle the new function and return appropriate messages for content generation. - Enhanced `PageGenerationService` to utilize the new AI function for generating page content based on blueprints. - Modified `prompts.py` to include detailed content generation requirements for the new function. - Updated site rendering logic to accommodate structured content blocks in various layouts.
3.2 KiB
3.2 KiB
Site Builder Workflow - Explanation & Fix
The Problem (FIXED)
You were experiencing confusion because there were TWO separate systems that weren't properly connected:
- Page Blueprint (
PageBlueprint.blocks_json) - Contains placeholder/sample blocks from AI structure generation - Writer Content (
Contentmodel) - Contains actual generated content from Writer tasks
The disconnect: When deploying a site, it only used PageBlueprint.blocks_json (placeholders), NOT the actual Content from Writer.
Current Workflow (How It Works Now)
Step 1: Structure Generation
- AI generates site structure → Creates
SiteBlueprintwithPageBlueprintpages - Each
PageBlueprinthasblocks_jsonwith placeholder/sample blocks
Step 2: Content Generation
- Pages are sent to Writer as
Tasks(title pattern:[Site Builder] {Page Title}) - Writer generates actual content → Creates
Contentrecords Contenthashtml_contentandjson_blockswith real content
Step 3: Publishing Status
- Page Blueprint Status (
PageBlueprint.status): Set to'published'in Page Manager- Controls if page appears in navigation and is accessible
- Content Status (
Content.status): Set to'publish'in Content Manager- Controls if actual written content is used (vs placeholders)
Step 4: Deployment (FIXED)
- When you deploy,
SitesRendererAdapter._build_site_definition()now:- For each page, finds the associated Writer Task (by title pattern)
- Finds the Content record for that task
- If Content exists and status is 'publish', uses
Content.json_blocksinstead ofPageBlueprint.blocks_json - If Content has
html_contentbut nojson_blocks, converts it to a text block - Uses the merged/actual content blocks for deployment
URLs
- Public Site URL:
https://sites.igny8.com/{siteSlug}- Shows deployed site with actual content (if Content is published)
- Falls back to blueprint placeholders if Content not published
- Individual Pages:
https://sites.igny8.com/{siteSlug}/{pageSlug}- Example:
https://sites.igny8.com/auto-g8/products
- Example:
How To Use It Now
- Generate Structure: Create site blueprint with pages (has placeholder blocks)
- Generate Content: Pages → Tasks → Content (Writer generates real content)
- Publish Content: In Content Manager, set Content status to
'publish' - Publish Pages: In Page Manager, set Page status to
'published'(for navigation) - Deploy Site: Deploy the blueprint - it will automatically use published Content
What Changed
✅ Fixed: SitesRendererAdapter._build_site_definition() now merges published Content into PageBlueprint blocks during deployment
✅ Result: When you deploy, the site shows actual written content, not placeholders
Important Notes
- Two Statuses: Page status controls visibility, Content status controls which content is used
- Deployment Required: After publishing Content, you need to redeploy the site for changes to appear
- Content Takes Precedence: If Content is published, it replaces blueprint placeholders
- Fallback: If Content not published, blueprint placeholders are used