Documentation
¶
Index ¶
- func BuildSiteStructure(site *SiteInfo)
- func CleanOutputDir(dir string) error
- func CopyStaticFiles(staticDir, outputDir string) error
- func LoadTemplates(layoutDir string) (*template.Template, error)
- func ParseContent(contentDir string, site *SiteInfo, buildTarget string, outputDir string) error
- func RenderPages(site *SiteInfo, outputDir string, buildTarget string) error
- func ServeSite(outputDir string, serverPort string)
- type Page
- type SiteInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildSiteStructure ¶
func BuildSiteStructure(site *SiteInfo)
--- buildSiteStructure (MODIFIED) --- This function now walks up the directory tree to find the nearest parent section.
func CopyStaticFiles ¶
--- copyStaticFiles - Unchanged ---
func LoadTemplates ¶
--- loadTemplates - Unchanged ---
func ParseContent ¶
--- parseContent - Unchanged --- Uses the globally configured `md` variable which now includes the Table extension.
func RenderPages ¶
--- renderPages - Unchanged --- It now accepts the build target and passes it to the template context.
Types ¶
type Page ¶
type Page struct { SourcePath string // Original path in content/ OutputPath string // Target path in the specified output directory URL string // Absolute URL path (e.g., "/chapter1/page1/") used for internal logic RelativeURL string // Path relative to output root (e.g., "chapter1/page1/index.html") used by templates RelPathToRoot string // Path from page to root (e.g., "../../" or "/") used by templates Title string // Page title from front matter Weight int // Weight for ordering from front matter ContentHTML template.HTML // Processed HTML content from Markdown IsHome bool // Is this the root _index.md? IsSection bool // Is this an _index.md file (a section index)? FrontMatter map[string]interface{} // Store all front matter Pages []*Page // Child pages (for sections), sorted by weight Section *Page // Parent section page (nil for top-level sections/home) Site *SiteInfo // Link back to global site info }
--- Structs (Page, SiteInfo) - Unchanged --- Page holds information about a single content file
Click to show internal directories.
Click to hide internal directories.