Documentation
¶
Overview ¶
Package builder implements the HTML renderer, search index writer, and asset copier for kwelea.
The primary entry point is Build, which performs a two-pass pipeline:
Parse pass — every non-draft Markdown page is processed by parser.Parse. The resulting HTML, table-of-contents, and optional H1 title are stored on each nav.Page.
Render pass — each page is executed through the html/template pipeline (layout.html → page.html + partials) and written to <output_dir>/<path>/index.html.
After both passes, Build copies embedded CSS/JS/font assets to the output directory and writes search-index.json for client-side FlexSearch.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type PageData ¶
type PageData struct {
Site *nav.Site
Page *nav.Page
SectionLabel string // nav section containing this page (empty for root pages)
DevMode bool // true only during `kwelea serve`
SourceURL string // URL path to the co-located raw Markdown source file
}
PageData is the template context passed to every page render.
type SearchEntry ¶
type SearchEntry struct {
ID string `json:"id"`
Title string `json:"title"`
Path string `json:"path"`
Body string `json:"body"`
}
SearchEntry is one document in the search index written to search-index.json. The JS client loads this file and builds an in-memory FlexSearch index from it.