Phase 7 part 5: add a section to an existing page
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>
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
{{define "content"}}{{with .Data}}{{$d := .}}
|
||||
<p><a href="/sites{{with .Current}}?site={{.Index}}{{end}}">← Sections and pages</a></p>
|
||||
<h1>Add a section</h1>
|
||||
<p class="lede">One more section on a page that's already on the site, of one of the site's own types: a FAQ for the questions people search, a comparison table, more features. The AI writes it from the page, your profile and the Inventory, with the same rules as a new page: nothing invented, claims of experience to confirm, a pull request that adds only that section.</p>
|
||||
{{with .Page}}
|
||||
<form method="post" action="/sites/pages/add?site={{$d.Current.Index}}" class="card" data-busy="Reading the page and writing…">
|
||||
<input type="hidden" name="page" value="{{.Path}}">
|
||||
<p>On <a href="{{$d.Current.Base}}{{.Path}}" target="_blank" rel="noopener noreferrer">{{.Path}}</a> <strong>{{.Title}}</strong>: {{join .Types " · "}}</p>
|
||||
<div class="cols">
|
||||
<label>Section type
|
||||
<select name="type">{{range $d.Types}}{{if not .Missing}}<option value="{{.Name}}" {{if eq .Name $d.Type}}selected{{end}}>{{.Name}}{{if .Uses}} (used on {{len .Pages}} pages){{end}}</option>{{end}}{{end}}</select>
|
||||
</label>
|
||||
<label>Where
|
||||
<select name="at">{{range $i, $t := .Types}}<option value="{{$i}}">Before section {{inc $i}} ({{$t}})</option>{{end}}<option value="{{len .Types}}" selected>At the end</option></select>
|
||||
<span class="help">Before the page's closing call to action reads best, usually.</span>
|
||||
</label>
|
||||
</div>
|
||||
<label>What it's for <span class="muted">(optional)</span>
|
||||
<textarea name="notes" rows="3" placeholder="Answer the questions people search for this page; compare us with the big help desks.">{{$d.Notes}}</textarea></label>
|
||||
<div class="actions"><button type="submit">Write the section</button></div>
|
||||
<p class="small muted">It reads the site's repository first. Writing takes a minute.</p>
|
||||
</form>
|
||||
{{end}}
|
||||
{{end}}{{end}}
|
||||
@@ -24,11 +24,15 @@
|
||||
{{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>
|
||||
@@ -61,12 +65,14 @@
|
||||
{{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>
|
||||
{{if eq $p.Status "merged"}}
|
||||
{{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>
|
||||
|
||||
@@ -80,7 +80,7 @@
|
||||
{{with $d.SectionPages}}
|
||||
<div class="table-wrap"><table class="compact">
|
||||
<thead><tr><th>Address</th><th>Title</th><th>Sections</th>{{if $d.Conv}}<th class="num" title="Visits that began on the page, in 90 days (Plausible)">Visits</th><th class="num" title="Of those, the ones that went on to sign up or send a form">Sign-ups</th>{{end}}</tr></thead>
|
||||
<tbody>{{range .}}<tr><td><a href="{{$d.Current.Base}}{{.Path}}" target="_blank" rel="noopener noreferrer">{{.Path}}</a>{{if .Draft}} <span class="badge draft">draft</span>{{end}}</td><td>{{.Title}}</td><td class="small">{{join .Types " · "}}</td>{{if $d.Conv}}{{with conv $d.Conv .Path}}<td class="num">{{num .Visitors}}</td><td class="num">{{if .Conversions}}<strong>{{num .Conversions}}</strong>{{else}}<span class="muted">0</span>{{end}}</td>{{end}}{{end}}</tr>{{end}}</tbody>
|
||||
<tbody>{{range .}}<tr><td><a href="{{$d.Current.Base}}{{.Path}}" target="_blank" rel="noopener noreferrer">{{.Path}}</a>{{if .Draft}} <span class="badge draft">draft</span>{{end}}</td><td>{{.Title}}</td><td class="small">{{join .Types " · "}} <a class="small" href="/sites/pages/add?site={{$d.Current.Index}}&page={{.Path}}">Add a section</a></td>{{if $d.Conv}}{{with conv $d.Conv .Path}}<td class="num">{{num .Visitors}}</td><td class="num">{{if .Conversions}}<strong>{{num .Conversions}}</strong>{{else}}<span class="muted">0</span>{{end}}</td>{{end}}{{end}}</tr>{{end}}</tbody>
|
||||
</table></div>
|
||||
{{else}}<p class="help">No page is built from sections yet.</p>{{end}}
|
||||
{{with $d.OtherPages}}
|
||||
|
||||
Reference in New Issue
Block a user