Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PageRef ¶
type PageRef struct {
ID int
Slug string
PostType string
Language string
TranslationGroupID *int
UpdatedAt time.Time
}
PageRef is the sitemap-relevant projection of a published content item: its identity for translation grouping, its slug and type for filtering, and its timestamps for freshness. Core projects content items into it so this package never imports the content domain.
type PublishedPages ¶
PublishedPages lists published content for sitemap generation. Core satisfies it with a closure over the content service (which cannot be imported here); tests stub it with a func literal.
type SEOHandler ¶
type SEOHandler struct {
// contains filtered or unexported fields
}
SEOHandler serves sitemap and robots discovery surfaces.
func NewSEOHandler ¶
func NewSEOHandler( pages PublishedPages, baseURL string, headless bool, logger kernel.Logger, ) *SEOHandler
NewSEOHandler constructs an SEOHandler over the given published-pages source. A nil logger degrades to a discard sink so the handler is safe to construct in any context.
func (*SEOHandler) GetRobotsTxt ¶
func (h *SEOHandler) GetRobotsTxt(w http.ResponseWriter, r *http.Request)
func (*SEOHandler) GetSitemapData ¶
func (h *SEOHandler) GetSitemapData(w http.ResponseWriter, r *http.Request)
func (*SEOHandler) GetSitemapXML ¶
func (h *SEOHandler) GetSitemapXML(w http.ResponseWriter, r *http.Request)
GetSitemapXML serves the sitemaps.org XML document crawlers expect at /sitemap.xml (the path robots.txt advertises). The JSON shape served at /api/v1/sitemap is for programmatic callers; crawlers need XML. In headless mode there is no server-rendered content site, so every /<slug> URL would 404 — the XML sitemap is disabled (404) rather than advertising dead URLs.