Phase 5 part 1: read a site's section types and pages

Sites → Sections and pages reads the website's Hugo repository: each
section type with the README's description, the fields in use and the
layout's, the pages using it and a real example; the pages and their
sections; the latest commits. Working copies are now held by one job at a
time.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-22 13:52:35 -07:00
co-authored by Claude Opus 5.5
parent 00e6deee00
commit 1152cd448b
15 changed files with 958 additions and 11 deletions
+55
View File
@@ -1207,6 +1207,61 @@ into `main`. **Parts 1 to 6 built, and merged into `main` on 2026-11-22**
user's Gitea hooks deploy it to their Hugo server. The app shows the last
merge, and checks the live site afterwards to confirm it changed.
**Started 2026-11-22** on branch `phase5-sites`, after Phase 4 was merged
into `main`.
**Decisions (the user, 2026-11-22):**
- **Pages are built from each site's own sections**, not a new shared
theme. federated-website (about 20 section types) and webcoredesktop
(about 15) already use the same `sections:` front matter pattern, each
with its own layouts. Supermarket reads a site's section types (the
partials in `layouts/partials/sections/`, the README's field table, and
how existing pages use them) and composes pages from them. Nothing in
the layouts changes. A shared theme can come later.
- **Previews are built and served by the app**, under
`localhost:8470/preview/…`: Hugo builds the branch, so no second port is
needed.
**Parts, in order, a commit after each:**
1. **Reading a site.**
- Sync the website's repository (Phase 3's working copy).
- The section catalogue: each section type with its fields (from the
README's table and from the pages that use it), an example from a
real page, and how many pages use it.
- The pages, with their address, title and section types.
- The last merge on the publish branch, from Gitea.
- A Sites page per website.
2. **Preview.** Build a branch (the published one, or a pull request's)
and serve it under `/preview/<site>/<branch>/`, so a page can be seen
before it's merged.
3. **The page builder.**
- New pages of a kind: landing page, product page, "<competitor>
alternative", comparison, blog post.
- Built from the profile, the Inventory, a buying signal (its angle,
with CTAs carrying its campaign tag) or an SEO brief.
- The AI composes `sections:` using only the site's own types and
fields, and code checks every type exists.
- Opened as a pull request, checked with a build, with a preview link.
4. **Pages per signal** (Phase 2's part 8): a landing page per buying
signal, created from the scorecard, and duplicated (to test a variant)
or deleted from it, always as pull requests.
5. **Publishing status.** After a merge, check the live site: the page is
there, its title matches, and the change shows. List the recent merges.
**Part 1 built (2026-11-22; no schema change).** `internal/sites` reads a
working copy: section types are the partials in
`layouts/partials/sections/`, less the helpers other partials call (head,
ctas, wrapper…); each type gets the README's description (table rows or
list items), the fields pages use (with list items' keys), the fields its
layout reads, the pages using it, and its fullest real use as YAML in the
page's own field order. Types pages use without a layout are flagged. Pages
list their address, title and section types; TOML pages are listed but not
read. `hugorepo` gained a per-copy lock (so two jobs can't reset one copy at
once; every SEO job now takes it), `Log` and `PathOf`. Sites → Sections and
pages (`/sites`) reads the repository on request and shows the latest
commits on the published branch. Live: federated-website has 25 section
types and 59 pages (22 built from sections).
### Future enhancements
Not in any phase yet; picked up when the user asks.