Phase 3 part 7: Bing, IndexNow and search engine setup

SEO → Search engines: a pull request that adds the IndexNow key file, a
robots.txt naming the sitemap, and turns the sitemap on when the Hugo
config disables it (checked with a build); IndexNow submissions of pages
that go live through Changes or Briefs once the key file is served; the
sitemaps Search Console has; and, with an API key, Bing's traffic,
searches and crawl issues. NewlyLive no longer queries while a result
set holds the database's only connection.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-22 08:45:13 -07:00
co-authored by Claude Opus 5.5
parent bf933971dd
commit 2302fb0436
18 changed files with 1061 additions and 4 deletions
+60
View File
@@ -0,0 +1,60 @@
{{define "content"}}{{with .Data}}{{$d := .}}
<div class="heading"><h1>Search engines</h1></div>
<p class="lede">What Google and Bing know about the site, and IndexNow, which tells Bing and other engines the moment a page changes, so they don't wait for their next crawl. Google doesn't use IndexNow; it reads the sitemap.</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/engines?site={{.Index}}" {{if eq .Index $d.Current.Index}}aria-current="page"{{end}}>{{.URL}}</a>{{end}}</nav>{{end}}
<section class="card">
<h2>Set the site up for search engines</h2>
<p>One pull request that adds what's missing: the IndexNow key file, a <code>robots.txt</code> that names the sitemap (unless the site has its own), and the sitemap itself if the Hugo config turns it off. A Hugo build checks all three come out.</p>
{{with .Setup}}
{{if .Error}}<p class="error-text small">Last try, {{ago .At}}: {{.Error}}</p>
{{else}}<p class="small">Opened {{ago .At}}: <a href="{{.PRURL}}" target="_blank" rel="noopener noreferrer">pull request #{{.PRNumber}} ↗</a>. {{range .Done}}{{.}} {{end}}<br><span class="muted">{{.Note}}</span></p>{{end}}
{{end}}
<form method="post" action="/seo/engines/setup?site={{.Current.Index}}" data-busy="Opening…"><button type="submit" {{if not .Gitea}}disabled title="Save a Gitea token under Settings → Search engines"{{end}}>{{if .Setup}}Open it again{{else}}Open the pull request{{end}}</button></form>
</section>
<section class="card">
<h2>IndexNow</h2>
<p class="small">Key <code>{{.Key}}</code>, published at <a href="{{.KeyURL}}" target="_blank" rel="noopener noreferrer">{{.KeyURL}}</a>:
{{if .KeyLive}}<span class="ok">the site serves it.</span> Pages that go live through Changes or Briefs are submitted on their own.
{{else}}<span class="warn-text">not on the site yet.</span> Merge the setup pull request above; until then nothing is submitted.{{end}}</p>
{{if .KeyLive}}<form method="post" action="/seo/engines/ping?site={{.Current.Index}}" class="inline"><button type="submit" class="secondary small">Submit the home page now</button></form>{{end}}
{{if .Pings}}
<table class="list"><thead><tr><th>When</th><th>Pages</th><th>Result</th></tr></thead>
<tbody>{{range .Pings}}<tr><td>{{ago .At}}</td><td class="small">{{range .URLs}}<a href="{{.}}" target="_blank" rel="noopener noreferrer">{{pagePath .}}</a> {{end}}</td>
<td class="small">{{if .Error}}<span class="error-text">{{.Error}}</span>{{else}}accepted ({{.Status}}){{end}}</td></tr>{{end}}</tbody></table>
{{end}}
</section>
<section class="card">
<h2>Google: sitemaps</h2>
{{if not .GoogleConnected}}<p class="help">Connect Search Console and choose this website's property under <a href="/settings/search">Settings → Search engines</a>.</p>
{{else if .SitemapsErr}}<p class="error-text">{{.SitemapsErr}}</p>
{{else if .Sitemaps}}
<table class="list"><thead><tr><th>Sitemap</th><th>Submitted</th><th>Last read</th><th>Pages</th><th>Problems</th></tr></thead>
<tbody>{{range .Sitemaps}}<tr><td class="small">{{.Path}}</td><td class="small">{{with .LastSubmitted}}{{ago .}}{{end}}</td><td class="small">{{with .LastDownloaded}}{{ago .}}{{else}}{{if .IsPending}}pending{{end}}{{end}}</td>
<td class="num">{{range .Contents}}{{if eq .Type "web"}}{{.Submitted}}{{end}}{{end}}</td><td class="small">{{if or (ne .Errors "0") (ne .Warnings "0")}}errors: {{.Errors}}, warnings: {{.Warnings}}{{else}}none{{end}}</td></tr>{{end}}</tbody></table>
{{else}}<p class="warn-text small">Google has no sitemap for this site. Once the site has one, submit it in Search Console (Indexing → Sitemaps): Supermarket's access is read-only.</p>{{end}}
</section>
<section class="card">
<h2>Bing</h2>
{{if not .BingSite}}<p class="help">Save a Bing Webmaster API key under <a href="/settings/search">Settings → Search engines</a> to see Bing's numbers.</p>
{{else if .BingErr}}<p class="error-text">{{.BingErr}} <span class="small muted">(site: {{.BingSite}})</span></p>
{{else}}
{{if .BingDays}}<table class="list"><thead><tr><th>Week of</th><th class="num">Clicks</th><th class="num">Impressions</th></tr></thead>
<tbody>{{range .BingDays}}<tr><td>{{.Date.Format "2 Jan 2006"}}</td><td class="num">{{num .Clicks}}</td><td class="num">{{num .Impressions}}</td></tr>{{end}}</tbody></table>
{{else}}<p class="help">No traffic data from Bing yet.</p>{{end}}
{{if .BingQueries}}<h3>Searches, last 4 weeks</h3>
<table class="list"><thead><tr><th>Search</th><th class="num">Impressions</th><th class="num">Clicks</th><th class="num">Position</th></tr></thead>
<tbody>{{range .BingQueries}}<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>{{end}}
<h3>Crawl issues</h3>
{{if .BingIssues}}<ul class="small">{{range .BingIssues}}<li>{{.URL}}{{if .HTTPCode}} ({{.HTTPCode}}){{end}}</li>{{end}}</ul>{{else}}<p class="help">None.</p>{{end}}
{{end}}
</section>
{{end}}
{{end}}{{end}}