Documentation
¶
Index ¶
- type Manager
- func (m *Manager) AllPages() []*PageNode
- func (m *Manager) Discover() error
- func (m *Manager) GenerateSearchIndex() []SearchEntry
- func (m *Manager) GetBreadcrumbs(urlPath string) []*PageNode
- func (m *Manager) GetHome() *PageNode
- func (m *Manager) GetNavigation() []*PageNode
- func (m *Manager) GetPage(urlPath string) (*PageNode, bool)
- func (m *Manager) GetPrevNext(currentPath string) (prev, next *PageNode)
- func (m *Manager) Reload(filePath string) error
- func (m *Manager) ResolveBreadcrumbHref(path string) (string, bool)
- type PageNode
- type SearchEntry
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager handles multi-page site discovery and navigation
func (*Manager) GenerateSearchIndex ¶
func (m *Manager) GenerateSearchIndex() []SearchEntry
GenerateSearchIndex creates a search index from all pages
func (*Manager) GetBreadcrumbs ¶
GetBreadcrumbs returns the breadcrumb trail for a given path
func (*Manager) GetNavigation ¶
GetNavigation returns the navigation tree
func (*Manager) GetPrevNext ¶
GetPrevNext returns the previous and next pages for navigation
func (*Manager) ResolveBreadcrumbHref ¶ added in v0.3.9
ResolveBreadcrumbHref maps a breadcrumb crumb's stored path to a servable URL. Section/group crumbs carry a directory-style path (e.g. "/recipes") that is not itself a route: index pages register with a trailing slash ("/recipes/"), and some sections have no index page at all. It returns the path unchanged when a page is registered there, falls back to the index route (path + "/") when only that exists, and reports ok=false when nothing is servable — so the caller can render a plain label instead of a link that would 303-redirect back to the home page.
type PageNode ¶
type PageNode struct {
Title string // Page title from frontmatter or config
Path string // URL path (e.g., "/getting-started/installation")
FilePath string // Relative file path (e.g., "getting-started/installation.md")
Page *tinkerdown.Page // Parsed page content
IsHome bool // Whether this is the home page
Collapsed bool // For sections/groups: whether collapsed by default
Children []*PageNode // Child pages (for sections and groups)
}
PageNode represents a page in the site structure
func (*PageNode) ContainsPath ¶ added in v0.3.8
ContainsPath reports whether this node or any descendant has the given URL path. Used to keep a collapsed section/group open when it holds the active page, and to resolve a nested page's section in the search index.