Files
supermarket/internal/web/templates/seo-report.html
T
davidandClaude Opus 5.5 aeba28b658 SEO: daily clicks chart, top searches, percentages, daily email
- The morning check draws clicks by day, this week over the week before.
- The morning check and the Monday report list the searches that gained
  and lost most clicks (any size; real moves stay on their own list).
- The week's clicks and impressions show their change in percent.
- Settings → Search engines can email the morning check, at most once a
  day, when something really moved. Both emails carry the new lists.
- With a domain property, a line says how many clicks went to its other
  hosts (a shop, a Gitea…) and for which search.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 06:55:54 -07:00

59 lines
3.6 KiB
HTML

{{define "content"}}{{with .Data}}{{$d := .}}
<div class="heading">
<h1>Monday report</h1>
{{if .Current}}<div class="buttons">
<form method="post" action="/seo/report?site={{.Current.Index}}" data-busy="Writing…"><button type="submit" class="secondary">Write it now</button></form>
</div>{{end}}
</div>
<p class="lede">One page, the same every week, so this Monday compares with the last in seconds: three numbers, the searches that gained and lost most, the three pages that moved most, and the changes waiting for your yes. It's written every Monday{{if .Current}}, and can be emailed to you (Settings → Search engines){{end}}.</p>
{{template "seo-sites" .}}
{{if .Current}}
{{with .Report}}
<section class="card">
<p class="small muted">{{.WeekFrom}} to {{.WeekTo}}, against the week before · written {{ago .CreatedAt}}</p>
<h2>1. The week</h2>
<div class="funnel">
<div class="step"><span class="label">Clicks</span><strong>{{num .After.Clicks}}</strong><span class="rate">was {{num .Before.Clicks}}{{with change .Before.Clicks .After.Clicks}} · {{.}}{{end}}</span></div>
<div class="step"><span class="label">Impressions</span><strong>{{num .After.Impressions}}</strong><span class="rate">was {{num .Before.Impressions}}{{with change .Before.Impressions .After.Impressions}} · {{.}}{{end}}</span></div>
<div class="step"><span class="label">Position</span><strong>{{dec1 .After.Position}}</strong><span class="rate">was {{dec1 .Before.Position}}</span></div>
</div>
<p>{{.Where}}</p>
{{range .Outside}}<p class="small muted">{{.Sentence}}</p>{{end}}
</section>
{{template "query-changes" .}}
<section class="card">
<h2>2. The pages that moved most</h2>
{{range .Pages}}
<p><a href="{{.Key}}" target="_blank" rel="noopener noreferrer">{{pagePath .Key}}</a>: clicks {{num .Before.Clicks}} → <strong>{{num .After.Clicks}}</strong>, position {{dec1 .Before.Position}} → <strong>{{dec1 .After.Position}}</strong>
{{with .Why}}<br><span class="small">{{range .}}{{.}} {{end}}</span>{{end}}</p>
{{else}}<p class="help">No page moved.</p>{{end}}
</section>
<section class="card">
<h2>3. Waiting for your yes</h2>
{{range .Waiting}}
<p><a href="{{.Page}}" target="_blank" rel="noopener noreferrer">{{pagePath .Page}}</a><br><span class="small">{{.Why}}</span></p>
{{else}}<p class="help">Nothing is waiting: no change has been proposed.</p>{{end}}
{{if .Waiting}}<p class="help">Say yes or no to each on <a href="/seo/changes?site={{$d.Current.Index}}">Changes</a>: a yes opens a pull request.</p>{{end}}
{{with .Candidates}}
<h3>Worth a proposal</h3>
{{range .}}<p><a href="{{.Page}}" target="_blank" rel="noopener noreferrer">{{pagePath .Page}}</a><br><span class="small">{{.Why}}</span></p>{{end}}
<p class="help"><em>Propose changes</em> on <a href="/seo/changes?site={{$d.Current.Index}}">Changes</a> writes new wording for pages like these.</p>
{{end}}
</section>
{{else}}
<section class="card empty"><p>No report yet. It's written on Monday once there are two weeks of data, or now with <em>Write it now</em>.</p></section>
{{end}}
{{if gt (len .Reports) 1}}
<h2>Earlier reports</h2>
<table class="list">
<thead><tr><th>Week to</th><th class="num">Clicks</th><th class="num">Impressions</th><th class="num">Position</th></tr></thead>
<tbody>{{range .Reports}}<tr><td><a href="/seo/report?site={{$d.Current.Index}}&amp;week={{.WeekTo}}">{{.WeekTo}}</a></td><td class="num">{{num .After.Clicks}}</td><td class="num">{{num .After.Impressions}}</td><td class="num">{{dec1 .After.Position}}</td></tr>{{end}}</tbody>
</table>
{{end}}
{{end}}
{{end}}{{end}}