Phase 5 part 2: preview any branch of a site

Sites → Previews builds a branch with Hugo (drafts included) and serves it
under /preview/<site>/<branch>/, links rewritten to stay inside, behind a
sandboxing CSP so a branch's scripts can't act on the app or phone home.
The image now builds Hugo v0.170.1 from source; Alpine's 0.147.2 couldn't
build the site. Hugo's errors show their innermost cause.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-22 14:02:23 -07:00
co-authored by Claude Opus 5.5
parent 1152cd448b
commit 233c6ac630
13 changed files with 722 additions and 5 deletions
+17
View File
@@ -500,6 +500,23 @@ Throughout, also notice:
- [ ] With the Gitea server unreachable, *Read it again* says the read
failed and still shows the last good copy.
### Previews
- [ ] Sites → Previews lists the repository's branches, the published one
first and marked *published*, each with its latest commit.
- [ ] *Build preview* on the published branch says "Built just now";
*Open preview* opens the site in a new tab, looking like the live one.
- [ ] Links in the preview (menus, buttons, images) stay under
`/preview/…`; none lead to Supermarket's own pages.
- [ ] A branch with a draft page (e.g. a Supermarket pull request) shows the
draft in its preview.
- [ ] After new commits on a branch, *Read it again* on Sections and pages
makes the preview say the branch has moved on; *Build again* fixes it.
- [ ] A branch that doesn't build shows Hugo's error, and the last good
preview still opens.
- [ ] *Delete* removes the preview; its address then says there's none.
- [ ] Plausible doesn't count visits to a preview.
## 9. Search
- [ ] Searching for an inventory entry, a fetched item, a post, a prospect