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:
17
plugin.go
17
plugin.go
@@ -14,6 +14,7 @@ import (
|
||||
"git.golem15.com/golem15/sm-seo-plugin/classes"
|
||||
"git.golem15.com/golem15/sm-seo-plugin/models"
|
||||
"git.golem15.com/golem15/sm-seo-plugin/updates"
|
||||
"git.golem15.com/golem15/sm-sitemap-plugin/contract"
|
||||
"git.golem15.com/golem15/summercms/modules/backpack"
|
||||
"git.golem15.com/golem15/summercms/modules/pact"
|
||||
"git.golem15.com/golem15/summercms/modules/party"
|
||||
@@ -46,13 +47,21 @@ type Plugin struct {
|
||||
|
||||
func (p *Plugin) ID() string { return "golem15.seo" }
|
||||
|
||||
// Requires is empty: content types are found through signpost, never by
|
||||
// plugin ID.
|
||||
func (p *Plugin) Requires() []string { return nil }
|
||||
// SitemapPluginID is the sitemap plugin the SEO plugin requires: it
|
||||
// decides which addresses the sitemaps list (D-95). Content types are still
|
||||
// found through signpost, never by plugin ID.
|
||||
const SitemapPluginID = "golem15.sitemap"
|
||||
|
||||
// Requires names the sitemap plugin, whose Filter seam the SEO plugin
|
||||
// implements (D-95).
|
||||
func (p *Plugin) Requires() []string { return []string{SitemapPluginID} }
|
||||
|
||||
// Register publishes the sitemap filter (classes.SitemapFilter): noindex,
|
||||
// canonicalised and redirected addresses leave the sitemaps (D-95, D-24).
|
||||
// It reads the service lazily, since Boot builds the service.
|
||||
func (p *Plugin) Register(app *backpack.App) error {
|
||||
p.app = app
|
||||
return nil
|
||||
return app.Publish[contract.Filter](classes.SitemapFilter{Service: p.Service})
|
||||
}
|
||||
|
||||
// Boot builds the service on the application's database, signpost registry
|
||||
|
||||
Reference in New Issue
Block a user