Documentation
¶
Index ¶
- func BoolPtr(v bool) *bool
- func BoolVal(p *bool, fallback bool) bool
- func IntPtr(v int) *int
- func IntVal(p *int, fallback int) int
- func NormalizeBasePath(raw string) string
- func NormalizeDateFormat(raw string) string
- func Validate(cfg *SiteConfig, knownPlugins []string) (errs []validate.Error, warns []validate.Error)
- func ValidateVersioning(colName string, vc *VersioningConfig) error
- type AnalyticsSettings
- type AsidesSettings
- type BuildSettings
- type CodeblocksSettings
- type CollectionLabsConfig
- type CollectionPrevNextConfig
- type CollectionSidebarConfig
- type CollectionSiteConfig
- type CollectionTOCConfig
- type ContentLintRules
- type ContentLintSettings
- type ContentSettings
- type DeployConfig
- type ExternalCheckSettings
- type FooterSettings
- type HeadSettings
- type HeadTag
- type HeaderSettings
- type HeroCTA
- type HeroCode
- type HeroImageSettings
- type HeroSettings
- type HeroStat
- type HomepageSettings
- type I18nSettings
- func (s *I18nSettings) GetDefaultLanguage() string
- func (s *I18nSettings) IsLanguageCode(seg string) bool
- func (s *I18nSettings) IsMultiLang() bool
- func (s *I18nSettings) Language(code string) (LanguageConfig, bool)
- func (s *I18nSettings) LanguageCodes() []string
- func (s *I18nSettings) ResolveLang(lang string) string
- type IconSet
- type IconSettings
- type ImageSettings
- type LanguageConfig
- type LastUpdatedStrategy
- type LinkValidationSettings
- func (s *LinkValidationSettings) EffectiveExternalOnBroken() string
- func (s *LinkValidationSettings) EffectiveOnBroken() string
- func (s *LinkValidationSettings) EffectiveOnBrokenAnchor() string
- func (s *LinkValidationSettings) EffectiveOnLocalLinks() string
- func (s *LinkValidationSettings) EffectiveOnRelativeLinks() string
- func (s *LinkValidationSettings) EffectiveOnUnverifiedInternal() string
- func (s *LinkValidationSettings) EffectiveReport() string
- type LlmsTxtSettings
- type Logo
- type MarkdownSettings
- type MarkdownTOCSettings
- type NavLink
- type PluginSettings
- type PrefetchSettings
- type ResolveOptions
- type SearchSettings
- type SecurityConfig
- type ServerSettings
- type SidebarCollectionEntry
- type SidebarFile
- type SidebarItemEntry
- type SidebarNodeOverride
- type SidebarTabOverride
- type SiteConfig
- type SiteIdentity
- type SocialLink
- type TOCSettings
- type TaxonomyConfig
- type ThemeSettings
- type ValidationError
- type VersionBanner
- type VersionEntry
- type VersionRedirect
- type VersioningConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NormalizeBasePath ¶
NormalizeBasePath canonicalizes a user-supplied base path to the internal form. The canonical form always has a leading and trailing slash (e.g. "/docs/"), except the root case which is just "/".
"" -> "/" "/" -> "/" "docs" -> "/docs/" "/docs" -> "/docs/" "docs/" -> "/docs/" "/docs/" -> "/docs/" " /docs/ " -> "/docs/" "//docs//" -> "/docs/" "/a/b/" -> "/a/b/" "a//b" -> "/a/b/" "///" -> "/"
func NormalizeDateFormat ¶ added in v1.1.0
NormalizeDateFormat resolves theme.date_format to a Go layout string. An empty value yields the "short" preset, matching the format the theme used before the setting existed.
Since the locale-aware date work this is a format-time fallback used by the template layer (custom layouts, or languages without CLDR data), no longer applied eagerly at config load; Theme.DateFormat keeps the raw value.
"" -> "Jan 2, 2006" "short" -> "Jan 2, 2006" "long" -> "January 2, 2006" "iso" -> "2006-01-02" "2006/01" -> "2006/01" (raw Go layout, passed through)
func Validate ¶
func Validate(cfg *SiteConfig, knownPlugins []string) (errs []validate.Error, warns []validate.Error)
Validate checks the merged SiteConfig for invalid values. knownPlugins is the set of valid plugin names, collected by the build layer from the actual plugin registries. If nil, plugin name validation is skipped.
func ValidateVersioning ¶
func ValidateVersioning(colName string, vc *VersioningConfig) error
ValidateVersioning checks that a versioning config is self-consistent: LastVersion must appear in Versions[].ID, and version IDs must be unique.
Types ¶
type AnalyticsSettings ¶
type AsidesSettings ¶ added in v1.2.0
type AsidesSettings struct {
Style string `yaml:"style"`
}
AsidesSettings controls how :::note / :::tip aside blocks are styled. Style selects the visual treatment and its matching icon set: "classic" (the default) or "galaxy". Any other value, including empty, behaves as classic.
type BuildSettings ¶
type BuildSettings struct {
Output string `yaml:"output"`
BasePath string `yaml:"base_path"`
Clean *bool `yaml:"clean"`
Sitemap *bool `yaml:"sitemap"`
Minify *bool `yaml:"minify"`
// LastUpdated selects the strategy for page "last updated" timestamps:
// "git" — last commit time for the file, fall back to mtime on error (default)
// "mtime" — filesystem modification time
// "false" / "off" — disabled; no timestamp rendered
// Legacy YAML bool form is accepted: true → "mtime", false → "false" (with deprecation warning).
LastUpdated LastUpdatedStrategy `yaml:"last_updated"`
Feed *bool `yaml:"feed"`
Drafts *bool `yaml:"drafts"`
Future *bool `yaml:"future"`
Expired *bool `yaml:"expired"`
Parallel *bool `yaml:"parallel"`
Cache *bool `yaml:"cache"`
}
type CodeblocksSettings ¶
type CollectionLabsConfig ¶ added in v1.0.0
type CollectionLabsConfig struct {
Label string `yaml:"label"` // "Lab", "Exercise", "Activity", etc.
}
CollectionLabsConfig holds labs-specific overrides in sarde.yaml.
type CollectionSidebarConfig ¶
type CollectionSiteConfig ¶
type CollectionSiteConfig struct {
Enabled *bool `yaml:"enabled"`
Path string `yaml:"path"`
URLPrefix string `yaml:"url_prefix"`
Sort string `yaml:"sort"`
Layout string `yaml:"layout"`
Permalink string `yaml:"permalink"`
Paginate int `yaml:"paginate"`
Feed *bool `yaml:"feed"`
Tabs *bool `yaml:"tabs"`
Sidebar *CollectionSidebarConfig `yaml:"sidebar"`
TOC *CollectionTOCConfig `yaml:"toc"`
PrevNext *CollectionPrevNextConfig `yaml:"prev_next"`
Versioning *VersioningConfig `yaml:"versioning"`
Labs *CollectionLabsConfig `yaml:"labs"`
I18nFallback string `yaml:"i18n_fallback"` // "" (inherit site), "default", or "omit"
}
type CollectionTOCConfig ¶
type ContentLintRules ¶
type ContentLintRules struct {
HeadingMaxLength int `yaml:"heading_max_length"`
HeadingIncrement *bool `yaml:"heading_increment"`
ImageAltRequired *bool `yaml:"image_alt_required"`
NoEmptyLinks *bool `yaml:"no_empty_links"`
FrontmatterRequired []string `yaml:"frontmatter_required"`
TabsMarkerSyntax *bool `yaml:"tabs_marker_syntax"`
}
type ContentLintSettings ¶
type ContentLintSettings struct {
Enabled *bool `yaml:"enabled"`
Rules ContentLintRules `yaml:"rules"`
}
type ContentSettings ¶
type DeployConfig ¶
type DeployConfig struct {
Provider string `yaml:"provider"` // github, netlify, cloudflare, vercel, custom
Branch string `yaml:"branch"` // GitHub Pages branch (default: gh-pages)
SiteID string `yaml:"site_id"` // Netlify site ID
ProjectName string `yaml:"project_name"` // Cloudflare Pages project name
ProjectID string `yaml:"project_id"` // Vercel project ID
Command string `yaml:"command"` // Custom deploy command
RedirectFormat string `yaml:"redirect_format"` // html, netlify, vercel, all (default: all)
}
type ExternalCheckSettings ¶
type ExternalCheckSettings struct {
Check *bool `yaml:"check"` // default: false
Concurrency int `yaml:"concurrency"` // default: 8
Timeout string `yaml:"timeout"` // default: "10s" (parsed with time.ParseDuration)
Cache string `yaml:"cache"` // default: ".sarde/linkcache.json"
CacheTTL string `yaml:"cache_ttl"` // default: "72h"
OnBroken string `yaml:"on_broken"` // "warn" (default) | "error" | "ignore"
Ignore []string `yaml:"ignore"` // URL glob patterns to skip
Method string `yaml:"method"` // "head-then-get" (default) | "head" | "get"
}
type FooterSettings ¶
type FooterSettings struct {
}
type HeadSettings ¶
type HeaderSettings ¶
type HeroImageSettings ¶
type HeroSettings ¶
type HeroSettings struct {
Eyebrow string `yaml:"eyebrow"`
Title string `yaml:"title"`
Subtitle string `yaml:"subtitle"`
CTA *HeroCTA `yaml:"cta"`
SecondaryCTA *HeroCTA `yaml:"secondary_cta"`
Stats []HeroStat `yaml:"stats"`
Code *HeroCode `yaml:"code"`
Image *HeroImageSettings `yaml:"image"`
Background string `yaml:"background"`
}
type HomepageSettings ¶
type HomepageSettings struct {
Template string `yaml:"template"`
Hero HeroSettings `yaml:"hero"`
}
type I18nSettings ¶
type I18nSettings struct {
DefaultLanguage string `yaml:"default_language"`
Strategy string `yaml:"strategy"` // "prefix-except-default" (default)
Fallback string `yaml:"fallback"` // "default" | "omit"
Strict bool `yaml:"strict"`
Languages map[string]LanguageConfig `yaml:"languages"`
}
func (*I18nSettings) GetDefaultLanguage ¶
func (s *I18nSettings) GetDefaultLanguage() string
GetDefaultLanguage returns the configured default language code, or "en" if unset.
func (*I18nSettings) IsLanguageCode ¶
func (s *I18nSettings) IsLanguageCode(seg string) bool
IsLanguageCode reports whether seg is a registered language code.
func (*I18nSettings) IsMultiLang ¶
func (s *I18nSettings) IsMultiLang() bool
IsMultiLang returns true when the site has multiple languages configured.
func (*I18nSettings) Language ¶
func (s *I18nSettings) Language(code string) (LanguageConfig, bool)
Language returns the config for a language code, or false if not found.
func (*I18nSettings) LanguageCodes ¶
func (s *I18nSettings) LanguageCodes() []string
LanguageCodes returns all configured language codes sorted by weight then alphabetically.
func (*I18nSettings) ResolveLang ¶
func (s *I18nSettings) ResolveLang(lang string) string
ResolveLang returns the default language code when lang is empty, otherwise lang.
type IconSet ¶
IconSet names an extra Iconify JSON collection to load, by prefix, from a file path (relative to the project root).
type IconSettings ¶
type IconSettings struct {
DefaultPrefix string `yaml:"default_prefix"`
Sets []IconSet `yaml:"sets"`
SetsDir string `yaml:"sets_dir"`
LocalDir string `yaml:"local_dir"`
Attribution string `yaml:"attribution"`
// Render selects the icon output mode: "inline" (default) emits a full SVG
// per use; "sprite" emits one hidden <symbol> per unique icon per page and
// references it with <use>.
Render string `yaml:"render"`
}
IconSettings configures the SVG icon system: the default set used for bare (prefixless) names, extra Iconify sets to load, a directory of local *.svg files (resolved before any set), an attribution line for sets that require one, and the output render mode.
type ImageSettings ¶
type LanguageConfig ¶
type LastUpdatedStrategy ¶
type LastUpdatedStrategy string
LastUpdatedStrategy is a string enum with back-compat for the legacy bool form.
func (*LastUpdatedStrategy) UnmarshalYAML ¶
func (l *LastUpdatedStrategy) UnmarshalYAML(value *yaml.Node) error
UnmarshalYAML accepts strings ("git", "mtime", "false") and legacy bools (true → "mtime", false → "false") with a deprecation warning.
type LinkValidationSettings ¶
type LinkValidationSettings struct {
Enabled *bool `yaml:"enabled"`
Level string `yaml:"level"`
OnBroken string `yaml:"on_broken"` // "error" (default) | "warn" | "ignore"
OnBrokenAnchor string `yaml:"on_broken_anchor"` // "error" (default) | "warn" | "ignore"
Report string `yaml:"report"` // "pretty" (default) | "json" | "github-actions"
OnRelativeLinks string `yaml:"on_relative_links"` // "warn" (default) | "error" | "ignore"
OnLocalLinks string `yaml:"on_local_links"` // "warn" (default) | "error" | "ignore"
OnUnverifiedInternal string `yaml:"on_unverified_internal"` // "warn" (default) | "error" | "ignore" — extension-less internal links that didn't resolve in-lane
CheckAnchors *bool `yaml:"check_anchors"`
CheckImages *bool `yaml:"check_images"`
SameSitePolicy string `yaml:"same_site_policy"`
SiteRootEscapePrefix string `yaml:"site_root_escape_prefix"` // prefix (e.g. "site:") routing a link to the site root, bypassing lane logic
Exclude []string `yaml:"exclude"`
Ignore []string `yaml:"ignore"`
FailBuild *bool `yaml:"fail_build"`
External ExternalCheckSettings `yaml:"external"`
}
func (*LinkValidationSettings) EffectiveExternalOnBroken ¶
func (s *LinkValidationSettings) EffectiveExternalOnBroken() string
func (*LinkValidationSettings) EffectiveOnBroken ¶
func (s *LinkValidationSettings) EffectiveOnBroken() string
func (*LinkValidationSettings) EffectiveOnBrokenAnchor ¶
func (s *LinkValidationSettings) EffectiveOnBrokenAnchor() string
func (*LinkValidationSettings) EffectiveOnLocalLinks ¶
func (s *LinkValidationSettings) EffectiveOnLocalLinks() string
func (*LinkValidationSettings) EffectiveOnRelativeLinks ¶
func (s *LinkValidationSettings) EffectiveOnRelativeLinks() string
func (*LinkValidationSettings) EffectiveOnUnverifiedInternal ¶
func (s *LinkValidationSettings) EffectiveOnUnverifiedInternal() string
func (*LinkValidationSettings) EffectiveReport ¶
func (s *LinkValidationSettings) EffectiveReport() string
type LlmsTxtSettings ¶
type Logo ¶
type Logo struct {
Light string `yaml:"light"`
Dark string `yaml:"dark"`
Alt string `yaml:"alt"`
// ReplacesTitle visually hides the site title text so only the logo shows.
// The title stays in the DOM (screen-reader only) so the link keeps an
// accessible name.
ReplacesTitle *bool `yaml:"replaces_title"`
}
Logo supports both string and object forms in YAML:
logo: "/img/logo.svg" logo: light: "/img/logo-light.svg" dark: "/img/logo-dark.svg" alt: "My Site" replaces_title: true
type MarkdownSettings ¶
type MarkdownSettings struct {
KaTeX *bool `yaml:"katex"`
Mermaid *bool `yaml:"mermaid"`
CDN *bool `yaml:"cdn"`
Unsafe *bool `yaml:"unsafe"`
Typographer *bool `yaml:"typographer"`
GithubAlerts *bool `yaml:"github_alerts"`
TripleColonCallouts *bool `yaml:"triple_colon_callouts"`
HardWraps *bool `yaml:"hard_wraps"`
TOC MarkdownTOCSettings `yaml:"toc"`
Codeblocks CodeblocksSettings `yaml:"codeblocks"`
Asides AsidesSettings `yaml:"asides"`
}
type MarkdownTOCSettings ¶
type NavLink ¶
type NavLink struct {
}
NavLink is a labeled URL used in header and footer navigation.
type PluginSettings ¶
type PrefetchSettings ¶
type ResolveOptions ¶
type ResolveOptions struct {
ConfigPath string // path to sarde.yaml (default: "sarde.yaml")
ThemeDir string // path to active theme dir (empty = skip theme layer)
CLIFlags map[string]any // flag overrides from Cobra
EnvPrefix string // env var prefix (default: "SARDE")
Strict bool // reject unknown fields in user sarde.yaml
KnownPlugins []string // valid plugin names (collected by build layer from registries)
}
ResolveOptions provides inputs for the 5-layer config cascade.
type SearchSettings ¶
type SecurityConfig ¶
type SecurityConfig struct {
BlockedHrefSchemes []string `yaml:"blocked_href_schemes"`
}
SecurityConfig holds security-related settings for content rendering.
type ServerSettings ¶
type SidebarCollectionEntry ¶ added in v1.0.0
type SidebarCollectionEntry struct {
// CollapseLevel, when set, expands sidebar groups at depth <= N by
// default and collapses deeper groups. Wins over the sarde.yaml
// collections.{name}.sidebar.collapse_level value.
CollapseLevel *int `yaml:"collapse_level"`
// Tabs holds tab-bar property overrides keyed by tab slug
// (tabbed docs collections only).
Tabs map[string]*SidebarTabOverride `yaml:"tabs"`
// Overrides holds node property overrides keyed by collection-relative
// path (for example "guide/advanced"). Keys address sections and pages.
Overrides map[string]*SidebarNodeOverride `yaml:"overrides"`
// Items is the structural sidebar skeleton (Phase 2). Declared so strict
// decoding accepts the key; Phase 1 warns and ignores it when non-empty.
Items []SidebarItemEntry `yaml:"items"`
}
SidebarCollectionEntry is one collection's block within sidebar.yaml.
type SidebarFile ¶ added in v1.0.0
type SidebarFile map[string]*SidebarCollectionEntry
SidebarFile is the parsed sidebar.yaml: a map from collection name to that collection's navigation overrides. nil means no sidebar.yaml was found and must behave identically to "file absent" (byte-identical-build invariant).
func LoadSidebarFile ¶ added in v1.0.0
func LoadSidebarFile(dir string) (SidebarFile, error)
LoadSidebarFile reads sidebar.yaml from dir (the directory containing sarde.yaml). Returns (nil, nil) if the file is absent or empty; the file is entirely optional. Decoding is always strict (unknown keys are hard errors): unlike sarde.yaml there is no legacy lenient mode to preserve for a brand-new file. Override and tab keys are canonicalized here; two raw keys that normalize to the same canonical key are a hard error, because letting map iteration order pick a winner would make builds nondeterministic.
type SidebarItemEntry ¶ added in v1.0.0
type SidebarItemEntry struct {
Label string `yaml:"label"`
Page string `yaml:"page"`
URL string `yaml:"url"`
External bool `yaml:"external"`
Badge engine.Badge `yaml:"badge"`
Collapsed *bool `yaml:"collapsed"`
Attrs map[string]string `yaml:"attrs"`
Autogenerate string `yaml:"autogenerate"`
Items []SidebarItemEntry `yaml:"items"`
}
SidebarItemEntry is one entry of the Phase 2 structural skeleton. Stub in Phase 1: the full schema (page/url/autogenerate/items recursion) lands with the structural feature.
type SidebarNodeOverride ¶ added in v1.0.0
type SidebarNodeOverride struct {
Label string `yaml:"label"`
Description string `yaml:"description"`
Order *int `yaml:"order"`
Collapsed *bool `yaml:"collapsed"`
Icon string `yaml:"icon"`
Badge engine.Badge `yaml:"badge"` // scalar or {text, variant} form
Hidden *bool `yaml:"hidden"` // nil = unset; false un-hides a frontmatter-hidden page
Attrs map[string]string `yaml:"attrs"`
}
SidebarNodeOverride overrides sidebar properties for one section or page.
type SidebarTabOverride ¶ added in v1.0.0
type SidebarTabOverride struct {
Label string `yaml:"label"`
Description string `yaml:"description"`
Icon string `yaml:"icon"`
Order *int `yaml:"order"`
}
SidebarTabOverride overrides tab-bar properties for one docs tab.
type SiteConfig ¶
type SiteConfig struct {
Site SiteIdentity `yaml:"site"`
Social []SocialLink `yaml:"social"`
Theme ThemeSettings `yaml:"theme"`
TOC TOCSettings `yaml:"toc"`
Header HeaderSettings `yaml:"header"`
Head HeadSettings `yaml:"head"`
Build BuildSettings `yaml:"build"`
Markdown MarkdownSettings `yaml:"markdown"`
Prefetch PrefetchSettings `yaml:"prefetch"`
Images ImageSettings `yaml:"images"`
Search SearchSettings `yaml:"search"`
Icons IconSettings `yaml:"icons"`
LinkValidation LinkValidationSettings `yaml:"link_validation"`
ContentLint ContentLintSettings `yaml:"content_lint"`
Analytics AnalyticsSettings `yaml:"analytics"`
Deploy DeployConfig `yaml:"deploy"`
Redirects map[string]string `yaml:"redirects"`
Collections map[string]*CollectionSiteConfig `yaml:"collections"`
Homepage HomepageSettings `yaml:"homepage"`
Plugins PluginSettings `yaml:"plugins"`
Taxonomies map[string]TaxonomyConfig `yaml:"taxonomies"`
Server ServerSettings `yaml:"server"`
Permalinks map[string]string `yaml:"permalinks"`
I18n I18nSettings `yaml:"i18n"`
Content ContentSettings `yaml:"content"`
LlmsTxt LlmsTxtSettings `yaml:"llms_txt"`
Security SecurityConfig `yaml:"security"`
// SidebarFile is the parsed root-level sidebar.yaml (nil when absent).
// Populated programmatically by Resolve, never from sarde.yaml content.
SidebarFile SidebarFile `yaml:"-"`
}
SiteConfig is the complete site configuration. Every field maps to a top-level key in sarde.yaml. Booleans use *bool so the merge layer can distinguish "not set" from "explicitly false".
func Defaults ¶
func Defaults() *SiteConfig
Defaults returns a fully populated SiteConfig from the embedded default YAML. This is layer 1 of the 5-layer config cascade. Panics if the embedded YAML is invalid (programmer error).
func LoadFile ¶
func LoadFile(path string) (*SiteConfig, error)
LoadFile reads a YAML config file and unmarshals it into a SiteConfig. Returns (nil, nil) if the file does not exist — missing config is not an error under the zero-config philosophy. Returns (nil, error) for invalid YAML.
func LoadFileStrict ¶
func LoadFileStrict(path string) (*SiteConfig, error)
LoadFileStrict reads a YAML config file with unknown-field detection enabled. Any field in the YAML that doesn't map to a SiteConfig struct field causes an error. Used only for the user's sarde.yaml (layer 3).
func Resolve ¶
func Resolve(opts ResolveOptions) (*SiteConfig, error)
Resolve loads and merges all config layers, returning the final SiteConfig.
Layer precedence (last wins):
- Embedded defaults (compiled into binary)
- theme.yaml (from active theme directory)
- sarde.yaml (user's project-level config)
- CLI flags
- Environment variables (SARDE_ prefix)
type SiteIdentity ¶
type SiteIdentity struct {
Title string `yaml:"title"`
Description string `yaml:"description"`
Author string `yaml:"author"`
URL string `yaml:"url"`
Logo Logo `yaml:"logo"`
Favicon string `yaml:"favicon"`
Language string `yaml:"language"`
EditURL string `yaml:"edit_url"`
TitleDelimiter string `yaml:"title_delimiter"`
HeadingLinks *bool `yaml:"heading_links"`
Custom404 string `yaml:"custom_404"`
}
type SocialLink ¶
type TOCSettings ¶
type TaxonomyConfig ¶
type TaxonomyConfig struct {
Singular string `yaml:"singular"`
PaginateBy int `yaml:"paginate_by"`
UndefinedTags string `yaml:"undefined_tags"`
Render *bool `yaml:"render"`
ShowTags *bool `yaml:"show_tags"`
}
TaxonomyConfig holds per-taxonomy settings. Accepts both short form ("tag") and full form ({singular: "tag", paginate_by: 20}) in YAML.
func (TaxonomyConfig) ShouldRender ¶
func (tc TaxonomyConfig) ShouldRender() bool
ShouldRender returns true if this taxonomy should generate pages. Default is true when Render is nil (not explicitly set).
func (*TaxonomyConfig) UnmarshalYAML ¶
func (tc *TaxonomyConfig) UnmarshalYAML(value *yaml.Node) error
type ThemeSettings ¶
type ThemeSettings struct {
Name string `yaml:"name"`
Preset string `yaml:"preset"`
Dark *bool `yaml:"dark"`
Overrides map[string]string `yaml:"overrides"`
DarkOverrides map[string]string `yaml:"dark_overrides"`
PrimaryColor string `yaml:"primary_color"`
AccentColor string `yaml:"accent_color"`
FontFamily string `yaml:"font_family"`
FontMono string `yaml:"font_mono"`
CodeLight string `yaml:"code_light"`
CodeDark string `yaml:"code_dark"`
// DateFormat controls the "last updated" date display. Accepts the
// preset names "short", "long", and "iso", or any raw Go layout. Kept raw
// here: the dateFormat template function resolves presets per page
// language (CLDR data when available, NormalizeDateFormat otherwise).
// Custom Go layouts always render English month names.
DateFormat string `yaml:"date_format"`
}
type ValidationError ¶ added in v1.4.0
ValidationError carries the structured validation failures so machine consumers (`--format json`, Sarde Studio) can present them individually. Its Error() string is identical to the previous flattened form, so pretty (terminal) output is unchanged.
func (*ValidationError) Error ¶ added in v1.4.0
func (e *ValidationError) Error() string
type VersionBanner ¶
type VersionBanner string
const ( BannerNone VersionBanner = "none" BannerUnmaintained VersionBanner = "unmaintained" BannerUnreleased VersionBanner = "unreleased" )
type VersionEntry ¶
type VersionEntry struct {
ID string `yaml:"id"`
Label string `yaml:"label"`
Path string `yaml:"path"`
Banner VersionBanner `yaml:"banner"`
Redirect VersionRedirect `yaml:"redirect"`
}
VersionEntry describes one version of a versioned docs collection.
type VersionRedirect ¶
type VersionRedirect string
const ( RedirectSamePage VersionRedirect = "same-page" RedirectRoot VersionRedirect = "root" )
type VersioningConfig ¶
type VersioningConfig struct {
Enabled *bool `yaml:"enabled"`
LastVersion string `yaml:"last_version"`
PublishLatestAtVersionURL bool `yaml:"publish_latest_at_version_url"`
Fallback string `yaml:"fallback"` // "" (inherit site), "default", or "omit"
Versions []VersionEntry `yaml:"versions"`
}
VersioningConfig controls docs versioning for a collection.