Phase 5 part 3: build pages from a site's own sections

Sites → New pages: the AI composes a landing, product, alternative,
comparison or blog page as the site's own sections, from the profile and
optionally a product, competitor, buying signal or SEO brief. Code checks
every section type, warns on unknown fields and missing pages, tags a
signal's links with its campaign and finds experience claims. Pages are
edited here, pushed to their own branch with a preview, and opened as pull
requests after the claims are confirmed. Schema 22.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-22 14:12:57 -07:00
co-authored by Claude Opus 5.5
parent 233c6ac630
commit 11b80b6461
15 changed files with 1737 additions and 1 deletions
+8
View File
@@ -28,6 +28,7 @@ import (
"supermarket/internal/secrets"
"supermarket/internal/seo"
"supermarket/internal/signals"
"supermarket/internal/sites"
)
//go:embed templates/*.html
@@ -178,6 +179,10 @@ func (s *Server) Handler() (http.Handler, error) {
mux.HandleFunc("POST /metrics/customers/{id}", s.metricsCustomerMatch)
mux.HandleFunc("GET /sites", s.sitesPage)
mux.HandleFunc("POST /sites/sync", s.sitesSync)
mux.HandleFunc("GET /sites/pages", s.sitePagesPage)
mux.HandleFunc("POST /sites/pages", s.sitePageNew)
mux.HandleFunc("GET /sites/pages/{id}", s.sitePagePage)
mux.HandleFunc("POST /sites/pages/{id}/{action}", s.sitePageAction)
mux.HandleFunc("GET /sites/previews", s.sitesPreviewsPage)
mux.HandleFunc("POST /sites/previews/build", s.sitesPreviewBuild)
mux.HandleFunc("POST /sites/previews/delete", s.sitesPreviewDelete)
@@ -307,6 +312,7 @@ func (s *Server) loadTemplates() error {
"join": strings.Join,
"ago": ago,
"ticks": ticks,
"kindLabel": sites.KindLabel,
"add": func(a, b int) int { return a + b },
"hasPrefix": strings.HasPrefix,
"sourceLabel": prospects.SourceLabel,
@@ -416,6 +422,8 @@ func (p page) Section() string {
return "Settings"
case p.Nav == "inventory":
return "Inventory"
case strings.HasPrefix(p.Nav, "sites"):
return "Sites"
}
return ""
}