Phase 6 part 5, step 3: theme updates by pull request

The theme carries a MANIFEST of its files' SHA-256s. A site's Theme card
shows its copy's version against Supermarket's and any files changed by
hand; Update the theme opens a pull request that writes new and changed
files, removes retired ones, rebuilds, and lists what it replaces.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-22 15:30:48 -07:00
co-authored by Claude Opus 5.5
parent 2a605ac265
commit 7da7c5fd9c
9 changed files with 384 additions and 6 deletions
+13 -2
View File
@@ -26,10 +26,21 @@
{{end}}
{{with .Catalog}}
{{if $d.Theme}}
{{with $d.Theme}}
<section class="card">
<h2>The theme</h2>
{{if .Outdated}}
<p>This site has Supermarket's theme version {{.Version}}; Supermarket has version {{.Latest}}.</p>
<form method="post" action="/sites/theme/update"><input type="hidden" name="site" value="{{$d.Current.Index}}">
<button type="submit" data-busy="Opening…" {{if not $d.Gitea}}disabled{{end}}>Update the theme</button>
<span class="small muted">Opens a pull request that replaces the site's copy, checked with a build.</span></form>
{{else}}<p class="ok">This site has Supermarket's theme, version {{.Version}}: the latest.</p>{{end}}
{{with .Edited}}<p class="warn-text small">Changed by hand in the site's copy of the theme: {{join . ", "}}. An update replaces them; such changes belong in the site's own <code>layouts/</code> or <code>static/</code>, which win over the theme.</p>{{end}}
{{with $d.ThemePR}}<p class="small">Last update: <a href="{{.URL}}" target="_blank" rel="noopener noreferrer">the pull request ↗</a>, {{ago .At}}.</p>{{end}}
</section>
<section class="card">
<h2>First pages</h2>
<p>This site uses Supermarket's theme (version {{$d.Theme}}). Build its pages: each is written from your profile, opens for you to edit and preview, and goes to the site as a pull request.</p>
<p>This site uses Supermarket's theme. Build its pages: each is written from your profile, opens for you to edit and preview, and goes to the site as a pull request.</p>
<div class="row-actions">
{{range $d.Kinds}}
<form method="post" action="/sites/pages"><input type="hidden" name="site" value="{{$d.Current.Index}}"><input type="hidden" name="kind" value="{{.}}">