Documentation
¶
Overview ¶
Package seo contributes Payload-familiar search metadata fields and a paired admin authoring experience without moving executable generators into the schema manifest.
Index ¶
- Constants
- func MetaDescription(hasGenerator bool, options ...field.StringOption) field.Definition
- func MetaImage(collection schema.CollectionSlug, hasGenerator bool, ...) field.Definition
- func MetaImageWithConfig(selected MetaImageConfig, options ...field.UploadOption) field.Definition
- func MetaTitle(hasGenerator bool, options ...field.StringOption) field.Definition
- func Overview(options ...field.CommonOption) field.Definition
- func OverviewWithConfig(selected OverviewConfig, options ...field.CommonOption) field.Definition
- func Preview(hasGenerator bool, options ...field.CommonOption) field.Definition
- func PreviewWithConfig(selected PreviewConfig, options ...field.CommonOption) field.Definition
- type Config
- type FieldsOverride
- type GenerateContext
- type GenerateImage
- type GenerateText
- type MetaImageConfig
- type OverviewConfig
- type Plugin
- type PreviewConfig
Constants ¶
const ( // Key is the stable backend/admin plugin identity. Key = "seo" // AdminPluginPairingVersion changes when the Go and admin packages cease to // understand the same renderer configuration. AdminPluginPairingVersion = 1 )
Variables ¶
This section is empty.
Functions ¶
func MetaDescription ¶
func MetaDescription(hasGenerator bool, options ...field.StringOption) field.Definition
MetaDescription returns the localized built-in textarea field with the SEO renderer.
func MetaImage ¶
func MetaImage(collection schema.CollectionSlug, hasGenerator bool, options ...field.UploadOption) field.Definition
MetaImage returns the localized upload reference with the SEO renderer.
func MetaImageWithConfig ¶
func MetaImageWithConfig(selected MetaImageConfig, options ...field.UploadOption) field.Definition
MetaImageWithConfig customizes the direct image field's presentation.
func MetaTitle ¶
func MetaTitle(hasGenerator bool, options ...field.StringOption) field.Definition
MetaTitle returns the localized built-in text field with the SEO renderer.
func Overview ¶
func Overview(options ...field.CommonOption) field.Definition
Overview returns the default presentation-only checks summary.
func OverviewWithConfig ¶
func OverviewWithConfig(selected OverviewConfig, options ...field.CommonOption) field.Definition
OverviewWithConfig returns overview checks mapped to explicit field paths and guidance bounds. Zero values use the default meta paths and bounds.
func Preview ¶
func Preview(hasGenerator bool, options ...field.CommonOption) field.Definition
Preview returns the default presentation-only search-result preview.
func PreviewWithConfig ¶
func PreviewWithConfig(selected PreviewConfig, options ...field.CommonOption) field.Definition
PreviewWithConfig returns a search preview mapped to explicit stored paths.
Types ¶
type Config ¶
type Config struct {
Collections []schema.CollectionSlug
Globals []schema.CollectionSlug
UploadsCollection schema.CollectionSlug
TabbedUI bool
Fields FieldsOverride
GenerateTitle GenerateText
GenerateDescription GenerateText
GenerateImage GenerateImage
GenerateURL GenerateText
}
Config selects resources and executable generation behavior.
type FieldsOverride ¶
type FieldsOverride func(defaultFields []field.Definition) ([]field.Definition, error)
FieldsOverride receives the immutable default field definitions and returns the complete ordered contents of the meta group.
type GenerateContext ¶
type GenerateContext struct {
Context ridu.PluginEndpointContext
Document map[string]any
ID string
Locale schema.LocaleCode
Collection *ridu.Collection
Global *ridu.Global
}
GenerateContext is the trusted runtime input for one generator. Document is the current unsaved admin form snapshot. Collection and Global are detached authoring definitions; exactly one is non-nil.
type GenerateImage ¶
type GenerateImage func(GenerateContext) (string, error)
GenerateImage produces the stable ID of an upload document.
type GenerateText ¶
type GenerateText func(GenerateContext) (string, error)
GenerateText produces a title, description, or preview URL.
type MetaImageConfig ¶
type MetaImageConfig struct {
Collection schema.CollectionSlug
Generate bool
Label string
Description string
}
MetaImageConfig customizes the direct image constructor without composing duplicate-sensitive field options over the Payload-compatible defaults.
type OverviewConfig ¶
type OverviewConfig struct {
Label string
TitlePath string
DescriptionPath string
ImagePath string
TitleMin int
TitleMax int
DescriptionMin int
DescriptionMax int
}
OverviewConfig maps the presentation-only overview checks to stored fields.
type Plugin ¶
type Plugin struct {
// contains filtered or unexported fields
}
Plugin is one configured SEO extension.
func New ¶
New returns one compiled plugin. Slices are copied so later application mutation cannot change target selection or endpoint admission.
func (*Plugin) Descriptor ¶
func (*Plugin) Descriptor() ridu.PluginDescriptor
Descriptor exposes only deterministic build metadata. Generators remain executable Go values owned by the runtime plugin instance.
func (*Plugin) Endpoints ¶
func (plugin *Plugin) Endpoints() []ridu.PluginEndpoint
Endpoints contributes generation calls below /api/plugins/seo/. All are declared for a stable OpenAPI surface; absent callbacks return an empty value.