Documentation
¶
Overview ¶
Package pattern is the site-layout pattern system: declarative packages that layer opinionated page templates above the active theme identity. Themes stay type/color/spacing; patterns are magazine/company/portfolio- style layouts selectable independently. See docs/PATTERN-PLUGINS.md.
Index ¶
Constants ¶
const EnvPatternsDir = "GORUN_PATTERNS"
EnvPatternsDir names the environment variable that points at the ship-with patterns directory.
const EnvPatternsExtra = "GORUN_PATTERNS_EXTRA"
EnvPatternsExtra lists extra pattern roots (PATH-separated), searched after the core directory. Operator-installed packages under DataDir/patterns win over ship-with packages of the same slug.
const SettingPattern = "site.pattern"
SettingPattern stores the active layout pattern slug (empty = none).
Variables ¶
var ( // ErrNotFound is returned for unknown pattern slugs. ErrNotFound = errors.New("pattern: not found") // ErrInvalid is returned for a broken pattern package. ErrInvalid = errors.New("pattern: invalid") )
Functions ¶
func ExtraPatternsDirs ¶
func ExtraPatternsDirs() []string
ExtraPatternsDirs returns directories listed in $GORUN_PATTERNS_EXTRA.
func PatternsDir ¶
PatternsDir returns the core patterns directory.
Types ¶
type Info ¶
type Info struct {
Slug string `json:"slug"`
Version string `json:"version"`
Name map[string]string `json:"name"`
Description map[string]string `json:"description"`
Dir string `json:"dir"`
Bundled bool `json:"bundled"`
}
Info is a discovered pattern package.
func (Info) DisplayDescription ¶
DisplayDescription picks a localized description.
func (Info) DisplayName ¶
DisplayName picks a localized label.
type Module ¶
type Module struct {
// contains filtered or unexported fields
}
Module is the pattern kernel.Module.
func (*Module) Migrations ¶
Migrations implements kernel.Module (settings key only).
type Option ¶
type Option func(*Module)
Option configures the module.
func WithPatternsDir ¶
WithPatternsDir sets the ship-with patterns directory.