fields

package
v0.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 21, 2026 License: Apache-2.0 Imports: 18 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package fields provides baseplate's built-in field kinds, blocks and content types (page, site settings), plus the standard SEO fields.

Index

Constants

View Source
const (
	PageType     = "page"
	SettingsType = settings.Type
)

Built-in content type names.

View Source
const (
	TabSEO = "SEO"
	TabLLM = "LLM"
	// TabMedia holds the media library's settings (a catalog key).
	TabMedia = "tab.media"
)

Tabs used by the standard field groups.

View Source
const (
	Text     = "text"
	Textarea = "textarea"
	RichText = "richtext"
	Slug     = "slug"
	Number   = "number"
	Bool     = "bool"
	Select   = "select"
	Image    = "image"
	Email    = "email"
	URL      = "url"
	Relation = "relation"
	Group    = "group"
	List     = "list"
	Blocks   = "blocks"
	// Date and DateTime store Unix seconds; the admin converts input in the
	// site's time zone, templates format with {{date v "long"}}.
	Date     = "date"
	DateTime = "datetime"
	// Timezone is an IANA zone name ("Europe/Berlin").
	Timezone = "timezone"
)

Kind names.

Variables

This section is empty.

Functions

func Kinds

func Kinds() []content.Kind

Kinds returns all built-in kinds.

func RoutableFields

func RoutableFields(fs ...content.Field) []content.Field

RoutableFields wraps the fields of a routable type with title, slug and SEO.

func SEOField

func SEOField() content.Field

SEOField is the standard SEO group added to every routable type.

func ValidCanonical added in v0.2.0

func ValidCanonical(s string) bool

ValidCanonical reports whether s can be a canonical URL: absolute http(s), or a path from the site root ("/other/") that the build resolves against the base URL.

Types

type Core

type Core struct{}

Core registers the built-in kinds and types (page, settings). The app registers it before any other plugin. The built-in blocks are separate (CoreBlocks), so a site only offers the blocks it registers.

func (Core) Name

func (Core) Name() string

func (Core) Register

func (Core) Register(r *plugin.Registry) error

type CoreBlocks

type CoreBlocks struct {
	Only []string
}

CoreBlocks registers baseplate's generic content elements (heading, richtext, image, cta, article). Opt in with app.Use(fields.CoreBlocks{}); Only restricts it to some of them.

func (CoreBlocks) Name

func (CoreBlocks) Name() string

func (CoreBlocks) Register

func (c CoreBlocks) Register(r *plugin.Registry) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL