Documentation
¶
Index ¶
- Variables
- func LayoutHasSidebar(layout LayoutType) bool
- func LayoutHasTOC(layout LayoutType) bool
- func ResolvePageVersion(page *Page) string
- func ValidateLayout(layout LayoutType) bool
- type Badge
- type BadgeVariant
- type BreadcrumbItem
- type BuildLogEntry
- type BuildLogger
- type BuildResult
- type CollectedLink
- type Collection
- type CollectionConfig
- type DocsTab
- type EditURLValue
- type FieldDef
- type Frontmatter
- type FrontmatterIdentity
- type FrontmatterMeta
- type FrontmatterNav
- type FrontmatterSchema
- type FrontmatterSidebar
- type FrontmatterTOC
- type GlobalNav
- type GlobalNavItem
- type HeadTag
- type Heading
- type HeroAction
- type HeroCTAData
- type HeroCodeData
- type HeroConfig
- type HeroData
- type HeroImage
- type HeroImageData
- type HeroStatData
- type HomepageData
- type IconLicense
- type Language
- type LayoutType
- type MarkdownRenderer
- type NavNode
- type NavOverride
- type NavTree
- type NodeKind
- type Page
- type PageBanner
- type PageContent
- type PageI18n
- type PageIdentity
- type PageMeta
- type PageRelationships
- type PageSidebar
- type PageTOC
- type PageTaxonomy
- type PageVersioning
- type PaginationLink
- type PaginationLinks
- type Paginator
- type PhaseTiming
- type PrevNextConfig
- type RenderResult
- type Resource
- type RouteAssets
- type RouteData
- type RouteI18n
- type RouteNav
- type RouteTabs
- type RouteVersioning
- type Section
- type SidebarConfig
- type SiteContext
- type TOCConfig
- type Taxonomy
- type TaxonomyTerm
- type TermEntry
- type ThemeConfig
- type ThemeResolver
- type TranslationLink
- type URLResolver
- type ValidationEntry
- type ValidationWarning
- type VersionConfig
- type VersionDef
- type VersionLink
Constants ¶
This section is empty.
Variables ¶
var AllowedHeadTags = map[string]bool{ "meta": true, "link": true, "script": true, "style": true, "noscript": true, "base": true, }
AllowedHeadTags lists the HTML tag names permitted in per-page head injection.
var VariantAliases = map[string]BadgeVariant{ "green": BadgeVariantTip, "amber": BadgeVariantCaution, "red": BadgeVariantDanger, }
VariantAliases maps legacy color names to semantic variants.
Functions ¶
func LayoutHasSidebar ¶
func LayoutHasSidebar(layout LayoutType) bool
LayoutHasSidebar returns true if the layout includes a sidebar.
func LayoutHasTOC ¶
func LayoutHasTOC(layout LayoutType) bool
LayoutHasTOC returns true if the layout includes a table of contents.
func ResolvePageVersion ¶
ResolvePageVersion returns the version string to pass to the URL resolver. Returns "" for unversioned pages or latest-version pages (produces the unprefixed alias URL). Returns the version ID for older versions.
func ValidateLayout ¶
func ValidateLayout(layout LayoutType) bool
ValidateLayout returns true if the layout type is recognized.
Types ¶
type Badge ¶
type Badge struct {
Text string `yaml:"text"`
Variant BadgeVariant `yaml:"variant"`
}
Badge represents a sidebar badge with a display label and a semantic variant.
Supports two YAML forms:
badge: "New" → Badge{Text: "New", Variant: "default"}
badge:
text: "New"
variant: "tip" → Badge{Text: "New", Variant: "tip"}
type BadgeVariant ¶
type BadgeVariant string
BadgeVariant is a semantic label for a sidebar badge's color scheme.
const ( BadgeVariantDefault BadgeVariant = "default" BadgeVariantNote BadgeVariant = "note" BadgeVariantTip BadgeVariant = "tip" BadgeVariantSuccess BadgeVariant = "success" BadgeVariantCaution BadgeVariant = "caution" BadgeVariantDanger BadgeVariant = "danger" )
type BreadcrumbItem ¶
BreadcrumbItem is a single entry in a breadcrumb trail.
type BuildLogEntry ¶
type BuildLogEntry struct {
Source string // e.g. "sitemap", "search", "social-cards"
Message string
}
BuildLogEntry is a single log message emitted during the build.
type BuildLogger ¶
type BuildLogger struct {
// contains filtered or unexported fields
}
BuildLogger collects log messages from the build pipeline and plugins. Thread-safe for use from parallel BuildDone plugin goroutines.
func NewBuildLogger ¶
func NewBuildLogger() *BuildLogger
NewBuildLogger creates an empty BuildLogger.
func (*BuildLogger) Log ¶
func (l *BuildLogger) Log(source, message string)
Log records a message from the given source.
func (*BuildLogger) Messages ¶
func (l *BuildLogger) Messages() []BuildLogEntry
Messages returns all collected log entries.
type BuildResult ¶
type BuildResult struct {
PageCount int
Duration time.Duration
Warnings []ValidationWarning
OutputDir string
// Summary stats (populated by full Build(), zero for incremental ContentRebuild).
PaginatorPages int
Collections int
BundleAssets int
StaticFiles int
ProcessedImages int
AliasCount int
SitemapCount int
// Build logging.
LogMessages []BuildLogEntry
PhaseTimings []PhaseTiming
}
BuildResult holds the outcome of a site build.
type CollectedLink ¶
CollectedLink represents a link found during markdown rendering.
type Collection ¶
type Collection struct {
Name string
Title string
Config *CollectionConfig
Pages []*Page
Featured []*Page // subset of Pages with frontmatter `featured: true`
Sections []*Section
IndexPage *Page
IsTabbed bool // true when docs tabs are auto-detected or forced
Tabs []*DocsTab // ordered by weight, then title
// Versioning
Versioning *VersionConfig
CompositeTabSets map[string][]*DocsTab // keyed by langVersionKey(lang, ver) for versioned+tabbed collections
}
Collection represents a group of pages (blog, docs, courses, etc.).
type CollectionConfig ¶
type CollectionConfig struct {
SortBy string
SortOrder string
Layout LayoutType
Permalink string
Paginate int
Feed bool
Sidebar *SidebarConfig
TOC *TOCConfig
PrevNext *PrevNextConfig
Tabs *bool // nil = auto-detect, true = force tabs, false = disable tabs
Versioning *VersionConfig // nil = no versioning
}
CollectionConfig holds per-collection settings (auto-detected or explicit).
type DocsTab ¶
type DocsTab struct {
Title string
Description string
Icon string // emoji, icon name, or SVG path
Slug string // directory name, used for URL prefix matching
Order int
Permalink string // URL of the tab's index page
Section *Section // the top-level section backing this tab
Pages []*Page
IndexPage *Page
}
DocsTab represents one tab in a tabbed docs collection. Each tab corresponds to a top-level subdirectory with its own nav tree.
type EditURLValue ¶
EditURLValue represents the per-page edit_url frontmatter field.
Supports three YAML forms:
edit_url: false → suppress the edit link edit_url: true → use the site-wide edit URL (default) edit_url: "https://..." → custom URL for this page
func (*EditURLValue) UnmarshalYAML ¶
func (e *EditURLValue) UnmarshalYAML(value *yaml.Node) error
type FieldDef ¶
type FieldDef struct {
Type string `yaml:"type" json:"type"` // "string", "int", "float", "bool", "date", "list", "enum"
Label string `yaml:"label" json:"label,omitempty"`
Required bool `yaml:"required" json:"required,omitempty"`
Default any `yaml:"default" json:"default,omitempty"`
Min *float64 `yaml:"min" json:"min,omitempty"`
Max *float64 `yaml:"max" json:"max,omitempty"`
MaxLength *int `yaml:"max_length" json:"maxLength,omitempty"`
Options []string `yaml:"options" json:"options,omitempty"` // for enum type
}
FieldDef describes a single frontmatter field for validation and editor UI.
type Frontmatter ¶
type Frontmatter struct {
FrontmatterIdentity `yaml:",inline"`
FrontmatterMeta `yaml:",inline"`
Sidebar FrontmatterSidebar `yaml:"sidebar"`
TOC FrontmatterTOC `yaml:"toc"`
Tags []string `yaml:"tags"`
Categories []string `yaml:"categories"`
Transparent bool `yaml:"transparent"`
Hero *HeroConfig `yaml:"hero"`
Icon string `yaml:"icon"`
Head []HeadTag `yaml:"head"`
Banner *PageBanner `yaml:"banner"`
Cascade map[string]any `yaml:"cascade"`
Params map[string]any `yaml:"params"`
}
Frontmatter represents parsed frontmatter fields from a content file. Sub-structs are embedded so all fields remain accessible as top-level names (e.g. fm.Title, fm.Draft, fm.Sidebar.Label).
type FrontmatterIdentity ¶
type FrontmatterIdentity struct {
Title string `yaml:"title"`
Slug string `yaml:"slug"`
Date time.Time `yaml:"date"`
Updated time.Time `yaml:"updated"`
PublishDate time.Time `yaml:"publish_date"`
ExpiryDate time.Time `yaml:"expiry_date"`
Aliases []string `yaml:"aliases"`
Layout string `yaml:"layout"`
Type string `yaml:"type"`
Template string `yaml:"template"`
}
FrontmatterIdentity holds core identity fields parsed from frontmatter.
type FrontmatterMeta ¶
type FrontmatterMeta struct {
Draft bool `yaml:"draft"`
Description string `yaml:"description"`
Image string `yaml:"image"`
Summary string `yaml:"summary"`
Render *bool `yaml:"render"`
Pagefind *bool `yaml:"pagefind"`
ShowUpdated *bool `yaml:"show_updated"`
EditURL *EditURLValue `yaml:"edit_url"`
}
FrontmatterMeta holds editorial and behavioral override fields.
type FrontmatterNav ¶
type FrontmatterNav struct {
}
FrontmatterNav holds prev/next navigation override fields.
type FrontmatterSchema ¶
FrontmatterSchema defines the expected frontmatter fields for a collection.
type FrontmatterSidebar ¶
type FrontmatterSidebar struct {
Order int `yaml:"order"`
Label string `yaml:"label"`
Hidden bool `yaml:"hidden"`
Group string `yaml:"group"`
Attrs map[string]string `yaml:"attrs"`
Badge Badge `yaml:"badge"`
Icon string `yaml:"icon"`
}
FrontmatterSidebar holds sidebar presentation fields.
type FrontmatterTOC ¶
type FrontmatterTOC struct {
Enabled *bool `yaml:"enabled"`
MinLevel int `yaml:"min_level"`
MaxLevel int `yaml:"max_level"`
}
FrontmatterTOC holds table-of-contents override fields.
Supports two YAML forms:
toc: false → FrontmatterTOC{Enabled: ptr(false)}
toc:
enabled: true
min_level: 2 → FrontmatterTOC{Enabled: ptr(true), MinLevel: 2}
func (*FrontmatterTOC) UnmarshalYAML ¶
func (t *FrontmatterTOC) UnmarshalYAML(value *yaml.Node) error
type GlobalNavItem ¶
type GlobalNavItem struct {
}
GlobalNavItem is a single entry in the global navigation bar.
type HeadTag ¶
type HeadTag struct {
Tag string `yaml:"tag"`
Attrs map[string]string `yaml:"attrs"`
Content string `yaml:"content"`
}
HeadTag defines a single injected <head> element from frontmatter.
type HeroAction ¶
type HeroAction struct {
Text string `yaml:"text"`
Link string `yaml:"link"`
Variant string `yaml:"variant"`
Icon string `yaml:"icon"`
Attrs map[string]string `yaml:"attrs"`
}
HeroAction defines a call-to-action button in the hero section.
type HeroCTAData ¶
HeroCTAData holds the call-to-action button settings.
type HeroCodeData ¶
HeroCodeData holds the optional code sample shown in the homepage hero.
type HeroConfig ¶
type HeroConfig struct {
Title string `yaml:"title"`
Tagline string `yaml:"tagline"`
Image *HeroImage `yaml:"image"`
Actions []HeroAction `yaml:"actions"`
}
HeroConfig defines hero section fields for splash layout pages.
func (*HeroConfig) SanitizeAttrs ¶
func (h *HeroConfig) SanitizeAttrs()
SanitizeAttrs strips event-handler attributes (on*) from all hero actions.
type HeroData ¶
type HeroData struct {
Eyebrow string
Title string
Subtitle string
CTA *HeroCTAData
SecondaryCTA *HeroCTAData
Stats []HeroStatData
Code *HeroCodeData
Image *HeroImageData
Background string
}
HeroData holds hero section settings for the homepage.
type HeroImage ¶
type HeroImage struct {
Src string `yaml:"src"`
Light string `yaml:"light"`
Dark string `yaml:"dark"`
Alt string `yaml:"alt"`
}
HeroImage defines the hero image with optional light/dark variants.
type HeroImageData ¶
HeroImageData holds the optional hero image/SVG for the homepage hero panel.
type HeroStatData ¶
HeroStatData holds a short proof point for the homepage hero.
type HomepageData ¶
HomepageData exposes homepage settings to templates.
type IconLicense ¶
IconLicense is the license metadata of a loaded icon set, exposed to templates as .Site.IconLicenses so a theme/author can render a credits page.
type LayoutType ¶
type LayoutType string
LayoutType determines the page layout (column structure).
const ( LayoutDefault LayoutType = "default" // single-column (blog, projects, standalone) LayoutDocs LayoutType = "docs" // three-column (sidebar | content | ToC) LayoutSplash LayoutType = "splash" // full-width, no sidebar or ToC (landing pages) LayoutWide LayoutType = "wide" // wider content with sidebar, no ToC LayoutFull LayoutType = "full" // full-width, no sidebar or ToC LayoutCentered LayoutType = "centered" // narrow centered column, no sidebar LayoutSplit LayoutType = "split" // two equal columns; no sidebar, no ToC LayoutPresentation LayoutType = "presentation" // full-width slide-viewer; no sidebar, no ToC )
func ResolveLayout ¶
func ResolveLayout(s string) LayoutType
ResolveLayout converts a string to a validated LayoutType, falling back to LayoutDefault.
type MarkdownRenderer ¶
type MarkdownRenderer interface {
Render(markdown string) (RenderResult, error)
}
MarkdownRenderer converts Markdown content to HTML via the Goldmark pipeline. Used as a parameter type by shortcode/processor to decouple from content/markdown.
type NavOverride ¶
type NavOverride struct {
}
NavOverride represents a per-page prev/next frontmatter override.
Supports three YAML forms:
prev: false → suppress the nav link
prev: "some-slug" → use page with this slug
prev: { link: "/url/", label: "..." } → explicit URL + label
func (*NavOverride) UnmarshalYAML ¶
func (n *NavOverride) UnmarshalYAML(value *yaml.Node) error
type NavTree ¶
type NavTree struct {
}
NavTree represents a complete sidebar navigation tree for a collection.
type NodeKind ¶
type NodeKind string
NodeKind classifies content files discovered during the filesystem walk.
type Page ¶
type Page struct {
PageIdentity
PageContent
PageMeta
PageRelationships
PageTaxonomy
Sidebar PageSidebar
TOC PageTOC
PageI18n
PageVersioning
Resources []Resource
Params map[string]any
}
Page represents a single content page. Sub-structs are embedded so all fields remain accessible as top-level names (e.g. page.Title, page.Tags).
type PageBanner ¶
type PageBanner struct {
Content string `yaml:"content"`
Variant string `yaml:"variant"` // note | tip | caution | danger (defaults to "note")
Icon string `yaml:"icon"` // Lucide icon name; overrides the variant's default icon
}
PageBanner defines a per-page announcement banner from frontmatter.
Supports one YAML form:
banner: content: "This page is under construction" variant: "caution" icon: "construction"
type PageContent ¶
type PageContent struct {
Content template.HTML
Summary template.HTML
RawContent string
ContentDigest string // hex digest of raw file bytes (for incremental rebuild skip)
FrontmatterDigest string // hex digest of serialized frontmatter map (body-only change detection)
WordCount int
ReadingTime int
Headings []Heading
HasCodeBlocks bool
HasImages bool
}
PageContent holds rendered content and content-derived metadata.
type PageI18n ¶
type PageI18n struct {
Lang string
LangRelPath string
Translations []*Page
AllTranslations []*Page
IsFallback bool
}
PageI18n holds language and translation fields.
type PageIdentity ¶
type PageIdentity struct {
Title string
Slug string
Date time.Time
Updated time.Time
PublishDate time.Time
ExpiryDate time.Time
Permalink string
RelPermalink string
Kind NodeKind
FilePath string
RelPath string
}
PageIdentity holds the core identity fields of a page.
func (*PageIdentity) URL ¶
func (p *PageIdentity) URL() string
URL returns the resolved Permalink if set, otherwise RelPermalink. In a fully built site, Permalink is always set. This accessor exists for robustness in tests and edge cases where Permalink may be empty.
type PageRelationships ¶
type PageRelationships struct {
Collection *Collection
Section *Section
PrevPage *Page
NextPage *Page
Siblings []*Page
Backlinks []*Page
}
PageRelationships holds graph connections to other pages and structures.
type PageSidebar ¶
type PageSidebar struct {
Order int
Label string
Hidden bool
Group string
Attrs map[string]string
Badge Badge
Icon string
}
PageSidebar holds sidebar presentation fields.
type PageTaxonomy ¶
type PageTaxonomy struct {
Tags []string
Categories []string
Aliases []string
Extra map[string][]string
}
PageTaxonomy holds taxonomy membership fields.
type PageVersioning ¶
PageVersioning holds version membership fields.
type PaginationLink ¶
PaginationLink is a reference to a prev or next page.
type PaginationLinks ¶
type PaginationLinks struct {
Prev *PaginationLink
Next *PaginationLink
}
PaginationLinks holds prev/next page references.
type Paginator ¶
type Paginator struct {
Pages []PaginationLink // Numbered links (one per page of results)
CurrentPages []*Page // Slice of content pages visible on this pagination page
Current int // 1-based index of the current page
Total int // Total number of pagination pages
HasPrev bool
HasNext bool
PrevURL string
NextURL string
TotalItems int // Total content items across all pagers
BaseURL string // Collection base URL for constructing custom pagination links
FirstURL string // Permalink to the first pagination page
LastURL string // Permalink to the last pagination page
}
Paginator holds numbered list-page pagination state for collection index pages.
type PhaseTiming ¶
PhaseTiming records the duration of a single build pipeline phase.
type PrevNextConfig ¶
PrevNextConfig controls prev/next navigation links.
type RenderResult ¶
type RenderResult struct {
HTML string
Headings []Heading
HasCodeBlocks bool
HasImages bool
Links []CollectedLink
}
RenderResult holds the output of a markdown-to-HTML conversion.
type Resource ¶
type Resource struct {
Name string
Title string
MediaType string
RelPermalink string
Width int
Height int
SrcPath string // absolute filesystem path for image processing
}
Resource represents a page-bundled asset (image, file, etc.).
type RouteAssets ¶
type RouteAssets struct {
Scripts []string
Styles []string
InlineScripts []template.JS
ModuleScripts []string
}
RouteAssets holds per-page asset URLs injected by plugins via BeforeRender.
type RouteData ¶
type RouteData struct {
Page *Page
Collection *Collection
Site *SiteContext
Theme *ThemeConfig
Layout LayoutType
Template string
RouteI18n
RouteVersioning
RouteTabs
RouteAssets
Homepage *HomepageData
Taxonomy *Taxonomy
TaxonomyTerm *TaxonomyTerm
TermEntries []*TermEntry
PageBanner *PageBanner
}
RouteData is the unified context object passed to every template render. Sub-structs are embedded so all fields remain accessible as top-level names in both Go code and html/template (e.g. .Lang, .Scripts, .Version).
type RouteI18n ¶
type RouteI18n struct {
Lang string
Dir string
Translations []TranslationLink
AllTranslations []TranslationLink
}
RouteI18n groups language and translation fields.
type RouteNav ¶
type RouteNav struct {
}
RouteNav groups navigation-related fields for the current page render.
type RouteVersioning ¶
type RouteVersioning struct {
Version string
VersionLabel string
Versions []VersionLink
IsLatest bool
VersionBanner string
}
RouteVersioning groups version-switcher fields for versioned collections.
type Section ¶
type Section struct {
Title string
Slug string
Permalink string
Pages []*Page
Sections []*Section
IndexPage *Page
Parent *Section
Collection *Collection
Transparent bool
Render bool
}
Section represents a directory with child pages and sub-sections.
type SidebarConfig ¶
SidebarConfig controls sidebar behavior for docs-layout collections.
type SiteContext ¶
type SiteContext struct {
Title string
BaseURL string
BasePath string // normalized: "/docs/" or "/"
Language string
Generator string
Favicon string
FaviconType string
SitemapEnabled bool
Config any // *config.SiteConfig at runtime; any to avoid circular imports
Collections map[string]*Collection
Taxonomies map[string]*Taxonomy
TaxonomiesByLang map[string]map[string]*Taxonomy
Pages []*Page
Data map[string]any
BuildTime time.Time
Languages []Language
DefaultLang string
EditURL string // base URL for "edit this page" links (e.g. https://github.com/user/repo/edit/main/content)
KazariScriptURL string // URL of the Kazari interaction JS file served globally on every page
IconLicenses []IconLicense // license metadata for loaded icon sets (for an attribution/credits page)
}
SiteContext provides global site data accessible in every template.
type Taxonomy ¶
type Taxonomy struct {
Name string
Singular string
Terms map[string]*TaxonomyTerm
Permalink string
PaginateBy int // 0 = no pagination for term listing pages
}
Taxonomy represents a grouping dimension (tags, categories, authors, etc.).
type TaxonomyTerm ¶
type TaxonomyTerm struct {
Name string
Slug string
CustomSlug string // from permalink field in data/*.yml; overrides Slugify(Name)
Permalink string
Pages []*Page
Label string
Description string
Color string
Icon string
Hidden bool
Priority int
Difficulty string // beginner, intermediate, advanced
ContentType string // lecture, lab, assignment, project, reference, tutorial, assessment
}
TaxonomyTerm is a single term within a taxonomy with its associated pages.
type TermEntry ¶
type TermEntry struct {
*TaxonomyTerm
Count int
PopTier int // 1-5 popularity quintile
}
TermEntry wraps a TaxonomyTerm with computed tag-cloud data.
type ThemeConfig ¶
type ThemeConfig struct {
Name string
Slug string
Version string
Author string
Tokens map[string]string
DarkTokens map[string]string
DarkEnabled bool
StyleTag template.HTML // pre-rendered <style> block with :root/:root[data-theme="dark"] tokens
}
ThemeConfig holds metadata, token values, and pre-rendered CSS for the active theme.
type ThemeResolver ¶
type ThemeResolver struct {
ProjectDir string // root of user project (contains layouts/, themes/)
ThemeName string // active theme name (for themes/<name>/layouts/)
EmbeddedFS fs.FS // compiled-in embedded/theme/ filesystem
}
ThemeResolver handles three-layer template/asset resolution (user → theme → embedded).
type TranslationLink ¶
type TranslationLink struct {
Lang string
Name string // display name (e.g. "Français"), falls back to Lang code
Dir string // "ltr" or "rtl"
URL string
Title string
IsFallback bool
}
TranslationLink points to the same page in another language.
type URLResolver ¶
type URLResolver struct {
BasePath string // normalized: "/docs/" or "/"
BaseURL string // origin only: "https://example.com"
I18nEnabled bool
DefaultLang string
Strategy string // "prefix-except-default"
Languages map[string]bool // set of known language codes
CollectionMounts []string // ["/docs", "/blog"] — populated by builder
VersionIDs map[string]bool // union of all version IDs across versioned collections
}
URLResolver resolves site-root-relative, prefix-free paths into final URLs. It is the single chokepoint for basePath, lang, and version prefixing.
func (*URLResolver) AbsURL ¶
func (r *URLResolver) AbsURL(relPath, lang, version string) string
AbsURL returns the fully-qualified URL (origin + resolved path).
func (*URLResolver) CacheKey ¶
func (r *URLResolver) CacheKey() string
CacheKey returns a deterministic digest of every field that affects URL resolution. The page-render cache must fold this into its content hash: rendered HTML embeds resolved links, so a change to base path, base URL, i18n, version, or collection layout must bust otherwise-identical content. Maps are sorted so the key is stable across map-iteration order.
func (*URLResolver) IsVersionID ¶
func (r *URLResolver) IsVersionID(seg string) bool
IsVersionID reports whether seg matches any configured version ID (union over all versioned collections).
func (*URLResolver) OutputRelPath ¶
func (r *URLResolver) OutputRelPath(relPath, lang, version string) string
OutputRelPath returns the on-disk output path: version- and lang-prefixed but WITHOUT basePath. Used to compute filesystem write paths where version and lang create real directories but basePath does not (the web server's mount handles basePath).
func (*URLResolver) URL ¶
func (r *URLResolver) URL(relPath, lang, version string) string
URL resolves a site-root-relative, prefix-free path to a final root-relative URL.
relPath: e.g. "/docs/guides/auth/" — always treated as site-root-relative. lang: language code; "" means default language. Non-default languages
get a /<lang>/ segment inserted (prefix-except-default strategy).
version: version ID for non-latest versions (e.g. "v1"); "" for latest/unversioned.
Inserted AFTER the collection mount, not as a global prefix.
type ValidationEntry ¶
type ValidationEntry struct {
Links []CollectedLink
FilePath string
}
ValidationEntry holds collected links for a single page, used by the link validator.
type ValidationWarning ¶
ValidationWarning represents a non-fatal issue found during frontmatter validation.
type VersionConfig ¶
type VersionConfig struct {
Enabled bool
LastVersion string // version ID that serves the root URL (no prefix)
PublishLatestAtVersionURL bool
Versions []VersionDef
}
VersionConfig holds versioning settings for a collection (engine-level mirror of config.VersioningConfig to avoid import cycles).
type VersionDef ¶
type VersionDef struct {
ID string
Label string
Path string // URL path segment (defaults to ID)
Banner string // "none" / "unmaintained" / "unreleased"
Redirect string // "same-page" / "root"
}
VersionDef describes one version of a versioned docs collection.
type VersionLink ¶
type VersionLink struct {
ID string
Label string
URL string // target URL (peer page or version root, based on redirect strategy)
Title string
IsCurrent bool
IsLatest bool // true if this is the last_version
Banner string // "none" / "unmaintained" / "unreleased"
Redirect string // "same-page" / "root"
}
VersionLink points to the same page in another version (mirrors TranslationLink).