Sites → Sections and pages → Add a section, on any page built from sections: choose one of the site's section types and where it goes; the AI writes it from the page, its searches, the profile and the Inventory, with the same rules as a new page. It's reviewed like a page (claims to confirm, to-dos), and the pull request inserts it into the page's file as text, so only that section is added; the build checks it. What to write next suggests a FAQ for a section page found with questions, and a comparison for one searched against something else. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
93 lines
6.6 KiB
HTML
93 lines
6.6 KiB
HTML
{{define "content"}}{{with .Data}}{{$d := .}}{{$p := .P}}
|
|
<div class="heading"><h1>{{or $p.Title "New page"}}</h1></div>
|
|
<p class="lede">{{.Kind}} for {{$p.Site}}{{with .From}}, from {{join . "; "}}{{end}}.
|
|
{{template "page-status" $p}}</p>
|
|
|
|
{{if or $p.PRURL .Preview $p.LiveNote}}
|
|
<section class="card">
|
|
{{with .Preview}}<p><a class="button" href="{{.}}" target="_blank" rel="noopener">Open the preview ↗</a> <span class="small muted">built {{ago $d.PreviewAt}} from the branch {{$p.Branch}}</span></p>{{end}}
|
|
{{with $p.PRURL}}<p>The pull request: <a href="{{.}}" target="_blank" rel="noopener noreferrer">{{.}} ↗</a>{{if eq $p.Status "merged"}}, merged {{ago $p.MergedAt}}{{end}}</p>{{end}}
|
|
{{with $p.Note}}<p class="small">{{.}}</p>{{end}}
|
|
{{if or (eq $p.Status "merged") (eq $p.Status "removing") (eq $p.Status "removed")}}
|
|
<div class="status-line">
|
|
{{if not $p.LiveAt.IsZero}}{{if ne $p.Status "removed"}}<p class="ok">On the live site since {{ago $p.LiveAt}}: <a href="{{$p.Address}}" target="_blank" rel="noopener noreferrer">{{$p.Address}} ↗</a></p>{{end}}{{end}}
|
|
{{if eq $p.Status "removed"}}{{if not $p.GoneAt.IsZero}}<p class="ok">Off the live site since {{ago $p.GoneAt}}.</p>{{end}}{{end}}
|
|
{{with $p.LiveNote}}<p class="small">{{if $d.Late}}<span class="warn-text">{{.}} It's been over two hours since the merge: check that the site's deploy (the Gitea hook) ran.</span>{{else}}{{.}}{{end}} {{if not $p.CheckedAt.IsZero}}<span class="muted">Checked {{ago $p.CheckedAt}}.</span>{{end}}</p>{{end}}
|
|
{{if $p.Waiting}}<form method="post" action="/sites/pages/{{$p.ID}}/check"><button type="submit" class="secondary small" data-busy="Checking…">Check the live site now</button></form>{{end}}
|
|
</div>
|
|
{{end}}
|
|
</section>
|
|
{{end}}
|
|
|
|
{{with $p.Source.Variant}}<p class="small">Variant <strong>{{.}}</strong>{{if $p.Source.VariantOf}} of <a href="/sites/pages/{{$p.Source.VariantOf}}">the original page</a>{{end}}.{{if $p.Source.VariantOf}} Its links to your site carry their own <code>utm_content</code>.{{end}}</p>{{end}}
|
|
{{with $p.RemovalPRURL}}<p>The pull request that takes it off the site: <a href="{{.}}" target="_blank" rel="noopener noreferrer">{{.}} ↗</a></p>{{end}}
|
|
{{with $p.Error}}<p class="error" role="alert">{{.}}</p>{{end}}
|
|
{{if $p.Editable}}
|
|
<form method="post" action="/sites/pages/{{$p.ID}}/save" class="card">
|
|
{{if eq $p.Kind "section"}}
|
|
<p>A new <strong>{{$p.Source.Type}}</strong> section for <a href="{{$p.Address}}" target="_blank" rel="noopener noreferrer">{{$p.Path}}</a>, going in as its section {{inc $p.Source.At}}. Only this section is added to the page's file; the rest of the page stays as it is.</p>
|
|
{{else}}
|
|
<div class="cols">
|
|
<label>Title <span class="muted">(for search results, under 60 characters)</span> <input name="title" value="{{$p.Title}}" maxlength="120"></label>
|
|
<label>Address {{if $p.File}}<span class="muted">(fixed: the file is on its branch)</span>{{end}} <input name="path" value="{{$p.Path}}" {{if $p.File}}readonly{{end}}></label>
|
|
</div>
|
|
<label>Description <span class="muted">(under 155 characters)</span> <textarea name="description" rows="2">{{$p.Description}}</textarea></label>
|
|
{{end}}
|
|
|
|
{{with $p.Warnings}}
|
|
<div class="warn card"><strong>To look at:</strong><ul>{{range .}}<li>{{.}}</li>{{end}}</ul></div>
|
|
{{end}}
|
|
|
|
<label>Sections <span class="muted">(the page's front matter: your site's section types, as YAML)</span>
|
|
<textarea name="sections" rows="28" class="mono" spellcheck="false">{{$p.Sections}}</textarea></label>
|
|
<label>Still to add or check by hand <span class="muted">(one per line; listed in the pull request)</span>
|
|
<textarea name="needs" rows="3">{{lines $p.Needs}}</textarea></label>
|
|
<label>What the page is for <span class="muted">(used when it's written again)</span>
|
|
<textarea name="notes" rows="3">{{$p.Notes}}</textarea></label>
|
|
|
|
{{with $p.Claims}}
|
|
<fieldset><legend>Confirm these are true before the pull request</legend>
|
|
<p class="small muted">They claim experience, tests or results. Tick each one that's true; edit the sections to take out any that aren't.</p>
|
|
{{range .}}<label class="check"><input type="checkbox" name="confirm" value="{{.}}"> {{.}}</label>{{end}}
|
|
</fieldset>
|
|
{{end}}
|
|
|
|
<div class="actions">
|
|
<button type="submit" class="secondary">Save</button>
|
|
<button type="submit" class="secondary" formaction="/sites/pages/{{$p.ID}}/rewrite" data-busy="Writing…">Write it again</button>
|
|
<button type="submit" class="secondary" formaction="/sites/pages/{{$p.ID}}/preview" data-busy="Pushing and building…" {{if not $d.Gitea}}disabled{{end}}>Push and preview</button>
|
|
<button type="submit" formaction="/sites/pages/{{$p.ID}}/pr" data-busy="Opening…" {{if not $d.Gitea}}disabled{{end}}>{{if $p.PRNumber}}Update the pull request{{else}}Open a pull request{{end}}</button>
|
|
</div>
|
|
<p class="small muted"><em>Write it again</em> uses your notes above and keeps what you've edited as its starting point. <em>Push and preview</em> puts the page on its own branch ({{or $p.Branch "supermarket/site-page-…"}}) and builds a preview, without a pull request.</p>
|
|
</form>
|
|
{{else}}
|
|
<section class="card"><pre class="sample">{{$p.Sections}}</pre></section>
|
|
{{end}}
|
|
|
|
<section class="card">
|
|
{{if ne $p.Kind "section"}}
|
|
<form method="post" action="/sites/pages/{{$p.ID}}/duplicate">
|
|
<label>Duplicate as a variant, to test against this one <span class="muted">(optional: what to change; empty makes an exact copy to edit)</span>
|
|
<textarea name="variant_notes" rows="2"></textarea></label>
|
|
<button type="submit" class="secondary" data-busy="Making it…">Make a variant</button>
|
|
</form>
|
|
{{end}}
|
|
{{if and (eq $p.Status "merged") (ne $p.Kind "section")}}
|
|
<form method="post" action="/sites/pages/{{$p.ID}}/remove" data-confirm="Open a pull request that takes {{$p.Path}} off the site?">
|
|
<button type="submit" class="secondary" data-busy="Opening…">Remove from the site</button>
|
|
<span class="small muted">Opens a pull request deleting the page; merging takes it off.</span>
|
|
</form>
|
|
{{end}}
|
|
{{if or (eq $p.Status "pr") (eq $p.Status "removing")}}
|
|
<form method="post" action="/sites/pages/{{$p.ID}}/close" data-confirm="Close the pull request without merging?">
|
|
<button type="submit" class="secondary">Close the pull request</button>
|
|
</form>
|
|
{{end}}
|
|
</section>
|
|
|
|
<form method="post" action="/sites/pages/{{$p.ID}}/delete" class="danger-zone">
|
|
<button type="submit" class="secondary" data-confirm="Forget this page? Its branch and pull request on Gitea stay.">Delete</button>
|
|
<span class="small muted">Forgets the page here. Its branch and pull request on Gitea stay; close them there.</span>
|
|
</form>
|
|
{{end}}{{end}}
|