feat(seo): metadata, previews and sitemaps for status pages and the app
ci / lint (push) Skipped
ci / test (push) Skipped
ci / build (push) Skipped
ci / image (push) Skipped
ci / lint (pull_request) Successful in 6m23s
ci / test (pull_request) Successful in 12m44s
ci / build (pull_request) Successful in 16m9s
ci / image (pull_request) Successful in 3m24s

Status pages describe themselves to search engines and link previews:
description (from the page's text, else its status), canonical address,
language versions via ?lang= with hreflang and x-default, Open Graph and
Twitter tags, and a 1200x630 preview image per page and language showing
its name and current status (/og.png). Each page has a sitemap.xml, and
robots.txt keeps crawlers off feeds, the API and subscription forms.
Component, legal and subscription pages are noindex.

In the cloud edition the app's sign-in, sign-up and legal pages get the
same tags with a preview image of their own, plus robots.txt and a
sitemap. Everything signed in stays noindex, and self-hosted
installations keep the whole app out of search engines.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
This commit is contained in:
Sebastian UnterschützandClaude Opus 5.5 committed 2026-11-28 22:50:34 +01:00
1 parent 918c71f283
commit 3baeb98ee2
23 files changed
+1546 -129

No files matched your search

+8 -1
View File
@@ -70,6 +70,8 @@ type Server struct {
// publicRegions caches the answer of the public region list.
publicRegions publicRegionsCache
// ogImages keeps the preview image of the public pages.
ogImages appImages
}
// Deps are the external resources a Server needs.
@@ -132,6 +134,9 @@ func (s *Server) Mount(r gin.IRouter) {
r.GET("/api/openapi.json", s.openAPIJSON)
// Public data for websites: no session, no CSRF.
r.GET("/api/v1/public/regions", s.listPublicRegions)
r.GET("/robots.txt", s.robotsTxt)
r.GET("/sitemap.xml", s.sitemapXML)
r.GET("/og.png", s.appOGImage)
r.GET("/install.sh", s.installScript)
g.GET("/api/docs", s.apiDocsPage)
@@ -336,7 +341,9 @@ func (s *Server) localize() gin.HandlerFunc {
pref = sess.Locale
}
cookie, _ := c.Cookie(localeCookie)
l := s.catalog.Match(pref, cookie, c.GetHeader("Accept-Language"))
// ?lang= shows a page in that language, so each language of the
// public pages has an address of its own.
l := s.catalog.Match(c.Query("lang"), pref, cookie, c.GetHeader("Accept-Language"))
c.Request = c.Request.WithContext(i18n.NewContext(c.Request.Context(), l))
c.Header("Content-Language", l.Lang())
c.Header("Vary", "Accept-Language, Cookie")