Documentation
¶
Index ¶
- func ApplyCascade(pages []*engine.Page)
- func BuildCollections(files []content.ContentFile, siteCfg *config.SiteConfig, contentDir string) (map[string]*engine.Collection, []engine.ValidationWarning, error)
- func BuildCollectionsWithOptions(files []content.ContentFile, siteCfg *config.SiteConfig, contentDir string, ...) (map[string]*engine.Collection, []engine.ValidationWarning, error)
- func BuildCompositeNavTrees(col *engine.Collection, langs []string) map[string]*engine.NavTree
- func BuildCompositeTabSets(col *engine.Collection, contentDir string, langs []string) map[string][]*engine.DocsTab
- func BuildSectionTree(pages []*engine.Page, collectionName string) []*engine.Section
- func BuildSinglePage(cf content.ContentFile, contentDir string, collCfg *engine.CollectionConfig, ...) (*engine.Page, []engine.ValidationWarning, error)
- func BuildStandalonePages(files []content.ContentFile, contentDir string, summaryLength int, ...) ([]*engine.Page, error)
- func BuildStandalonePagesWithOptions(files []content.ContentFile, contentDir string, summaryLength int, ...) ([]*engine.Page, error)
- func BuildTabs(col *engine.Collection, contentDir string) []*engine.DocsTab
- func BuildTabsI18n(col *engine.Collection, contentDir string, langs []string) []*engine.DocsTab
- func DetectTabs(col *engine.Collection) bool
- func FindTabForPage(tabs []*engine.DocsTab, page *engine.Page) *engine.DocsTab
- func InferCollection(dirName string) *engine.CollectionConfig
- func IsBlogName(name string) bool
- func LangVersionKey(lang, ver string) string
- func LinkVersions(pages []*engine.Page)
- func MergeCollectionConfig(inferred *engine.CollectionConfig, siteCfg *config.CollectionSiteConfig) *engine.CollectionConfig
- func RebuildNavTreesWithFallbacks(collections map[string]*engine.Collection, allPages []*engine.Page, ...)
- func SortPages(pages []*engine.Page, sortBy, sortOrder string)
- func WirePrevNext(pages []*engine.Page)
- type BuildOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyCascade ¶
ApplyCascade resolves frontmatter inheritance from section _index.md pages. Each section's `cascade` map is applied to all descendant pages that don't explicitly set those fields. Must be called after BuildSectionTree.
func BuildCollections ¶
func BuildCollections( files []content.ContentFile, siteCfg *config.SiteConfig, contentDir string, ) (map[string]*engine.Collection, []engine.ValidationWarning, error)
BuildCollections groups discovered files into typed collections, builds Pages, applies sorting, section trees, draft filtering, and prev/next wiring. Returns the collections map and any validation warnings.
func BuildCollectionsWithOptions ¶
func BuildCollectionsWithOptions( files []content.ContentFile, siteCfg *config.SiteConfig, contentDir string, opts BuildOptions, ) (map[string]*engine.Collection, []engine.ValidationWarning, error)
BuildCollectionsWithOptions groups discovered files into typed collections with optional parallel parsing.
func BuildCompositeNavTrees ¶
BuildCompositeNavTrees builds one NavTree per (lang, version) pair found in the collection's pages. Keyed by LangVersionKey. Used for versioned collections that may also be multi-language.
func BuildCompositeTabSets ¶
func BuildCompositeTabSets(col *engine.Collection, contentDir string, langs []string) map[string][]*engine.DocsTab
BuildCompositeTabSets builds one tab set per (lang, version) pair found in the collection's pages. Used for collections with both versioning and tabs.
func BuildSectionTree ¶
BuildSectionTree constructs a tree of Section nodes from pages. Pages with Kind==KindSection become section index pages. Other pages are assigned to their deepest matching section. Returns top-level sections for the collection.
func BuildSinglePage ¶
func BuildSinglePage( cf content.ContentFile, contentDir string, collCfg *engine.CollectionConfig, schema *engine.FrontmatterSchema, summaryLength int, lastUpdatedStrategy string, taxCfg map[string]config.TaxonomyConfig, ) (*engine.Page, []engine.ValidationWarning, error)
BuildSinglePage parses, infers, and transforms a single ContentFile into a Page. Used by incremental rebuild to re-parse a changed file without rebuilding all collections.
func BuildStandalonePages ¶
func BuildStandalonePages( files []content.ContentFile, contentDir string, summaryLength int, lastUpdatedStrategy string, ) ([]*engine.Page, error)
BuildStandalonePages builds Page objects for root-level files (home, standalone).
func BuildStandalonePagesWithOptions ¶
func BuildStandalonePagesWithOptions( files []content.ContentFile, contentDir string, summaryLength int, lastUpdatedStrategy string, opts BuildOptions, ) ([]*engine.Page, error)
BuildStandalonePagesWithOptions builds root-level pages with optional parallel parsing.
func BuildTabs ¶
func BuildTabs(col *engine.Collection, contentDir string) []*engine.DocsTab
BuildTabs creates DocsTab entries for a tabbed collection (single language).
func BuildTabsI18n ¶
BuildTabsI18n creates DocsTab entries with per-language nav trees.
func DetectTabs ¶
func DetectTabs(col *engine.Collection) bool
DetectTabs determines whether a collection should use tabbed docs mode. Returns true when: explicit config forces it, or auto-detection finds 2+ top-level sections all with _index.md and no loose root pages.
func FindTabForPage ¶
FindTabForPage returns the tab that contains the given page, or nil.
func InferCollection ¶
func InferCollection(dirName string) *engine.CollectionConfig
InferCollection returns a CollectionConfig with sensible defaults based on the directory name convention.
func IsBlogName ¶
IsBlogName returns true if the directory name maps to a blog-type collection.
func LangVersionKey ¶
LangVersionKey computes the composite map key for a (lang, version) pair.
func LinkVersions ¶
LinkVersions groups pages across versions by their VersionRelPath and populates each page's VersionPeers slice, mirroring i18n.LinkTranslations.
func MergeCollectionConfig ¶
func MergeCollectionConfig(inferred *engine.CollectionConfig, siteCfg *config.CollectionSiteConfig) *engine.CollectionConfig
MergeCollectionConfig overlays sarde.yaml collection values onto inferred defaults. Non-zero/non-nil site config values win over inferred values. Returns a new CollectionConfig (does not mutate the input).
func RebuildNavTreesWithFallbacks ¶
func RebuildNavTreesWithFallbacks(collections map[string]*engine.Collection, allPages []*engine.Page, langs []string)
RebuildNavTreesWithFallbacks rebuilds per-language nav trees after fallback pages have been generated, so every language gets a complete sidebar (real translations + fallback pages from the default language).
func SortPages ¶
SortPages sorts pages in-place by the given key and order. Supported keys: "date", "order", "title", "slug". Order: "asc" or "desc" (defaults to "asc"). Uses stable sort to preserve filesystem order for ties.
func WirePrevNext ¶
Types ¶
type BuildOptions ¶
BuildOptions controls content parsing work inside collection builders.