Documentation
¶
Overview ¶
Package seo is the official SEO module: metadata generation, sitemap and robots discovery surfaces, and legacy-URL aliases.
Index ¶
- Constants
- type Module
- func (m *Module) AdminManifest() kernel.AdminExtensionManifest
- func (m *Module) Handler() *api.SEOHandler
- func (m *Module) Init(_ kernel.Kernel) error
- func (m *Module) Migrations() fs.FS
- func (m *Module) Name() string
- func (m *Module) Optional() []string
- func (m *Module) Requires() []string
- func (m *Module) Shutdown() error
- func (m *Module) Version() string
- type Option
Constants ¶
const ( // Name is the registry key for this module. Name = "seo" // Version is the module version reported via Module.Version. Version = "0.1.0" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Module ¶
type Module struct {
// contains filtered or unexported fields
}
Module is the seo kernel module.
func New ¶
New builds the module, adopting the composition root's wiring. The handler is built once here so routes serve the same instance.
func (*Module) AdminManifest ¶
func (m *Module) AdminManifest() kernel.AdminExtensionManifest
AdminManifest declares this module's admin-shell extensions. SEO surfaces in the admin UI data-driven (the content editor's collapsible SEO settings read the content SEO API), so the module declares no menu entries, settings sections, or editor extensions.
func (*Module) Handler ¶
func (m *Module) Handler() *api.SEOHandler
Handler exposes the discovery-surface handler for core mounting. Core mounts it explicitly (rather than via RouteProvider) because the three leaves live in three different middleware groups (root, /api, /api/v1), which a single RegisterRoutes call cannot express.
func (*Module) Init ¶
Init wires the module. Migration execution is core-driven (it needs the live *sql.DB, which modules never touch directly).
func (*Module) Migrations ¶
Migrations returns the embedded migration filesystem, laid out per driver ({sqlite,postgresql,mysql}/NNN_name.{up,down}.sql). The core runner tracks each module in its own schema_migrations_<module> table.
func (*Module) Requires ¶
Requires lists hard dependencies. Aliases reference content items loosely (content IDs without foreign-key enforcement), so nothing is required.
type Option ¶
type Option func(*Module)
Option configures a Module. The composition root supplies every option; direct construction without options yields a standalone module that serves nothing (the handler built over a nil pages source must not be invoked).
func WithBaseURL ¶
WithBaseURL attaches the canonical site URL for absolute sitemap URLs. A trailing slash is trimmed at handler construction.
func WithHeadless ¶
WithHeadless disables the XML sitemap (no server-rendered site exists to advertise) and blocks all crawling in robots.txt.
func WithLogger ¶
WithLogger attaches the module logger. Without one handler failures are dropped (discard sink).
func WithPages ¶
func WithPages(pages api.PublishedPages) Option
WithPages attaches the published-content source for sitemap generation.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package admin owns this module's admin-shell manifest: the declarative UI the single admin SPA renders for SEO.
|
Package admin owns this module's admin-shell manifest: the declarative UI the single admin SPA renders for SEO. |
|
Package store is the single-source alias repository: one implementation against *sql.DB plus a kernel Dialect, replacing the three per-driver copies.
|
Package store is the single-source alias repository: one implementation against *sql.DB plus a kernel Dialect, replacing the three per-driver copies. |
|
Package testutil provides the kernel fixture module tests run against.
|
Package testutil provides the kernel fixture module tests run against. |