Documentation
¶
Index ¶
- type Metadata
- type Option
- func WithDescription(desc string, attrs templ.Attributes) Option
- func WithImage(image string, attrs templ.Attributes) Option
- func WithTitle(title string, attrs templ.Attributes) Option
- func WithType(objectType string, attrs templ.Attributes) Option
- func WithURL(url string, attrs templ.Attributes) Option
- type Property
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Metadata ¶
type Metadata struct {
Title Property `validate:"required"`
ObjectType Property `validate:"required"`
URL Property `validate:"required"`
Image Property `validate:"required"`
Description Property
}
Metadata represents the default opengraph metadata properties used by the app on pages.
func NewMetadata ¶
NewMetadata creates a new opengraph Metadata object with properties set to values given by the options. Where a property is not set by an option, a default value will be used.
type Option ¶
type Option func(*Metadata)
func WithDescription ¶
func WithDescription(desc string, attrs templ.Attributes) Option
WithDescription option sets a custom og:desc property with optional element attributes. If this option is not used a default description will be set.
func WithImage ¶
func WithImage(image string, attrs templ.Attributes) Option
WithImage option sets a custom og:image property with optional element attributes. If this option is not used a default image will be set.
func WithTitle ¶
func WithTitle(title string, attrs templ.Attributes) Option
WithTitle option sets a custom og:title property with optional element attributes. If this option is not used a default title will be set.
type Property ¶
type Property struct {
Value string
Attributes templ.Attributes
}