Files
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

83 lines
5.6 KiB
HTML

{{define "content"}}{{with .Data}}{{$d := .}}
<div class="heading">
<h1>Audit</h1>
</div>
<p class="lede">Every page Supermarket can find on the site (the sitemap's, the ones Google shows, and the pages they link to, up to {{.MaxPages}}), checked for what keeps a page from ranking or being clicked, and whether AI assistants can read and cite the site. Issues on the pages that bring traffic come first: their clicks and impressions are from Search Console's last 90 days. It runs on its own once a week.</p>
{{if not .Sites}}
<section class="card empty"><p>Add your websites to the <a href="/settings/profile">profile</a> first.</p></section>
{{else}}
{{if gt (len .Sites) 1}}<nav class="tabs">{{range .Sites}}<a href="/seo/audit?site={{.Index}}" {{if eq .Index $d.Current.Index}}aria-current="page"{{end}}>{{.URL}}</a>{{end}}</nav>{{end}}
<form method="post" action="/seo/audit?site={{.Current.Index}}" class="card row wrap" data-busy="Starting…">
<span>{{.Current.URL}}{{if not .Current.Property}} <span class="muted small">(no Search Console property: issues aren't ranked by traffic)</span>{{end}}</span>
<label class="check small"><input type="checkbox" name="speed"> Also check the speed of the 5 busiest pages (PageSpeed Insights, about a minute each)</label>
<button type="submit" {{with .Audit}}{{if eq .Status "running"}}disabled{{end}}{{end}}>Audit now</button>
</form>
{{with .Audit}}
{{if eq .Status "running"}}
<section class="card" hx-get="/seo/audit/status?site={{$d.Current.Index}}" hx-trigger="every 4s" hx-swap="none">
<p><span class="badge scheduled">auditing…</span> Started {{ago .StartedAt}}. This page updates when it's done.</p>
</section>
{{else if eq .Status "failed"}}
<section class="card"><p><span class="badge failed">failed</span> {{ago .StartedAt}}: {{.Error}}</p></section>
{{else}}
{{$c := .Counts}}
<section class="card">
<p class="small muted">Audited {{ago .FinishedAt}} · {{len .Pages}} pages read</p>
<div class="funnel">
<a class="step" href="/seo/audit?site={{$d.Current.Index}}&amp;severity=error"><span class="label">Errors</span><strong>{{or (index $c "error") 0}}</strong></a>
<a class="step" href="/seo/audit?site={{$d.Current.Index}}&amp;severity=warning"><span class="label">Warnings</span><strong>{{or (index $c "warning") 0}}</strong></a>
<a class="step" href="/seo/audit?site={{$d.Current.Index}}&amp;severity=notice"><span class="label">Notices</span><strong>{{or (index $c "notice") 0}}</strong></a>
<a class="step" href="/seo/audit?site={{$d.Current.Index}}"><span class="label">All</span><strong>{{len .Issues}}</strong></a>
</div>
</section>
<div class="grid">
<section class="card">
<h2>AI visibility</h2>
<ul class="checks">{{range .Checks}}{{if eq .Group "ai"}}<li class="{{if .OK}}ok{{else}}bad{{end}}"><strong>{{.Title}}</strong>{{with .Detail}}<br><span class="small">{{.}}</span>{{end}}</li>{{end}}{{end}}</ul>
</section>
<section class="card">
<h2>The basics</h2>
<ul class="checks">{{range .Checks}}{{if eq .Group "basics"}}<li class="{{if .OK}}ok{{else}}bad{{end}}"><strong>{{.Title}}</strong>{{with .Detail}}<br><span class="small">{{.}}</span>{{end}}</li>{{end}}{{end}}</ul>
</section>
</div>
{{if .Speed}}
<h2>Speed (mobile)</h2>
<table class="list">
<thead><tr><th>Page</th><th>Largest paint</th><th>Interaction</th><th>Layout shift</th><th class="num">Lab score</th></tr></thead>
<tbody>{{range .Speed}}<tr><td><a href="{{.Page}}" target="_blank" rel="noopener noreferrer">{{pagePath .Page}}</a></td>
{{if .Error}}<td colspan="4" class="small error-text">{{.Error}}</td>
{{else if .Field}}<td>{{.LCP}} ms <span class="small muted">{{.LCPRating}}</span></td><td>{{.INP}} ms <span class="small muted">{{.INPRating}}</span></td><td>{{dec1 (cls .CLS)}} <span class="small muted">{{.CLSRating}}</span></td><td class="num">{{.Score}}</td>
{{else}}<td colspan="3" class="small muted">Not enough real visitors for Google's field data.</td><td class="num">{{.Score}}</td>{{end}}</tr>{{end}}</tbody>
</table>
{{end}}
<h2>Issues{{with $d.Severity}}: {{.}}s{{end}}</h2>
{{if $d.Shown}}
<table class="list">
<thead><tr><th></th><th>Issue</th><th>Page</th><th class="num">Clicks</th><th class="num">Impressions</th></tr></thead>
<tbody>{{range $d.Shown}}<tr>
<td><span class="badge {{if eq .Severity "error"}}failed{{else if eq .Severity "warning"}}scheduled{{end}}">{{.Severity}}</span></td>
<td><strong>{{.Title}}</strong>{{with .Detail}}<br><span class="small">{{truncate 400 .}}</span>{{end}}
{{if or (hasPrefix .Code "title-") (hasPrefix .Code "description-")}}<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="{{.Title}}. {{.Detail}}">
<input type="hidden" name="what" value="{{if hasPrefix .Code "title-"}}title{{else}}description{{end}}">
<button type="submit" class="link small">Propose a fix</button></form>{{end}}</td>
<td class="small"><a href="{{.Page}}" target="_blank" rel="noopener noreferrer">{{pagePath .Page}}</a></td>
<td class="num">{{if .Traffic.Impressions}}{{num .Traffic.Clicks}}{{else}}<span class="muted">·</span>{{end}}</td>
<td class="num">{{if .Traffic.Impressions}}{{num .Traffic.Impressions}}{{else}}<span class="muted">·</span>{{end}}</td>
</tr>{{end}}</tbody>
</table>
{{with $d.More}}<p class="help">And {{.}} more.</p>{{end}}
{{else}}<p class="help">No issues{{with $d.Severity}} of this kind{{end}}.</p>{{end}}
{{end}}
{{else}}
<section class="card empty"><p>Not audited yet. <em>Audit now</em> reads the site; it takes a few minutes.</p></section>
{{end}}
{{end}}
{{end}}{{end}}