feat: sitemap filter excludes noindex, canonicalised and redirected URLs (tracer)
- classes.SitemapFilter implements the sitemap plugin's contract.Filter on the production values: redirected, noindex and canonicalised addresses leave the sitemaps with their reason; staging lists the same set - the plugin requires golem15.sitemap and publishes the filter in Register - go.mod requires sm-sitemap-plugin, go.work mounts the sibling checkout
This commit is contained in:
@@ -103,6 +103,10 @@ type MetaTag struct {
|
||||
// Resolver answers the effective SEO of a URL.
|
||||
type Resolver struct {
|
||||
Service *Service
|
||||
// production computes the values as production serves them: the
|
||||
// non-production lock (D-22) is not applied. The sitemap filter decides
|
||||
// on these, so staging lists the same addresses as production.
|
||||
production bool
|
||||
}
|
||||
|
||||
// Resolver returns the service's resolver.
|
||||
@@ -600,7 +604,7 @@ func (r *Resolver) resolveAt(ctx context.Context, db *gorm.DB, settings models.S
|
||||
layers = append(layers, robotsLayer{typeSetting.Robots, SourceTemplate})
|
||||
}
|
||||
robots, robotsSource := resolveRobots(layers)
|
||||
if res.Staging {
|
||||
if res.Staging && !r.production {
|
||||
robots, robotsSource = Robots{Index: "noindex", Follow: "nofollow"}, SourceDefault
|
||||
}
|
||||
seo.Robots, src["robots"] = robots.Header(), robotsSource
|
||||
|
||||
Reference in New Issue
Block a user