Files
supermarket/internal/web/templates/seo.html
T
davidandClaude Opus 5.5 438192faba Phase 3 part 4: changes approved one at a time, as Gitea pull requests
Proposals (at most 3 waiting) for pages on page one without clicks and
for the audit's title and description issues: the AI writes the title
(without the site's suffix, within the pixel budget) and description
from the live page and its searches. A yes syncs a working copy of the
site's Gitea repository (token as a header only), finds the page's Hugo
content file, sets title and description in its front matter, builds
with Hugo to check the page comes out as proposed, pushes a branch and
opens a pull request; it never merges. Merged changes are checked on
the live site, then compared before and after from Search Console.
Hugo is in the image. Schema 15.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 08:04:01 -07:00

59 lines
4.0 KiB
HTML

{{define "content"}}{{with .Data}}{{$d := .}}
<div class="heading">
<h1>What already ranks</h1>
{{if .Current}}<div class="buttons">
<form method="post" action="/settings/search/sync" data-busy="Syncing…"><input type="hidden" name="back" value="/seo?site={{.Current.Index}}"><button type="submit" class="secondary">Sync now</button></form>
</div>{{end}}
</div>
<p class="lede">The cheapest traffic is on pages that already rank. From Search Console, the last {{.Days}} days: the pages that carry your clicks, which to protect, and which to push because Google already shows them and nobody clicks.</p>
{{template "seo-sites" .}}
{{if .Current}}
{{with .Ranks}}
<section class="card">
<p class="small muted">{{.Site}} · {{.From}} to {{.To}} (Search Console's final data is 2 to 3 days behind).</p>
<div class="funnel">
<div class="step"><span class="label">Clicks</span><strong>{{num .Total.Clicks}}</strong></div>
<div class="step"><span class="label">Impressions</span><strong>{{num .Total.Impressions}}</strong></div>
<div class="step"><span class="label">Click rate</span><strong>{{dec1 .Total.CTR}}%</strong></div>
<div class="step"><span class="label">Average position</span><strong>{{dec1 .Total.Position}}</strong></div>
</div>
{{if ge .Anonymous 0.0}}<p class="small">{{dec1 .Anonymous}}% of the clicks come from searches Google doesn't name, so the query tables below read low; the page tables don't.</p>{{end}}
</section>
<div class="grid">
<section class="card">
<h2>Protect</h2>
<p class="help">They carry the clicks: don't rewrite them for fun, don't change their address, look at them first.</p>
{{range .Protect}}<p><a href="{{.Page}}" target="_blank" rel="noopener noreferrer">{{pagePath .Page}}</a><br><span class="small">{{.Why}}</span></p>{{else}}<p class="help">No page has clicks yet.</p>{{end}}
</section>
<section class="card">
<h2>Push</h2>
<p class="help">On page one, shown a lot, hardly clicked: Google did the hard part, and the page loses at the click. Compare its main query with its title first.</p>
{{range .Push}}<p><a href="{{.Page}}" target="_blank" rel="noopener noreferrer">{{pagePath .Page}}</a><br><span class="small">{{.Why}}</span>
<form method="post" action="/seo/changes/page?site={{$d.Current.Index}}" class="inline" data-busy="Writing…"><input type="hidden" name="page" value="{{.Page}}"><input type="hidden" name="why" value="{{.Why}}"><button type="submit" class="link small">Propose a new title and description</button></form></p>{{else}}<p class="help">No page sits on page one with few clicks. Good, or too little data.</p>{{end}}
</section>
</div>
<h2>Best pages</h2>
{{if .Pages}}
<table class="list">
<thead><tr><th>Page</th><th class="num">Clicks</th><th class="num">Impressions</th><th class="num">Click rate</th><th class="num">Position</th></tr></thead>
<tbody>{{range .Pages}}<tr><td><a href="{{.Page}}" target="_blank" rel="noopener noreferrer">{{pagePath .Page}}</a></td><td class="num">{{num .Clicks}}</td><td class="num">{{num .Impressions}}</td><td class="num">{{dec1 .CTR}}%</td><td class="num">{{dec1 .Position}}</td></tr>{{end}}</tbody>
</table>
{{else}}<p class="help">No pages with data yet.</p>{{end}}
<h2>Shown a lot, hardly clicked</h2>
<p class="help">The searches Google shows you for most, with a click rate under 1%.</p>
{{if .Unclicked}}
<table class="list">
<thead><tr><th>Query</th><th class="num">Impressions</th><th class="num">Clicks</th><th class="num">Position</th></tr></thead>
<tbody>{{range .Unclicked}}<tr><td>{{.Query}}</td><td class="num">{{num .Impressions}}</td><td class="num">{{num .Clicks}}</td><td class="num">{{dec1 .Position}}</td></tr>{{end}}</tbody>
</table>
{{else}}<p class="help">None.</p>{{end}}
{{else}}
<section class="card empty"><p>No data yet for {{.Current.Property}}. {{with .Current.Last}}{{if .Error}}The last sync failed: {{.Error}}{{else}}Synced {{ago .At}}, with nothing back.{{end}}{{else}}Sync now to read it.{{end}}</p></section>
{{end}}
{{end}}
{{end}}{{end}}