builder

package
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 16, 2026 License: MIT Imports: 27 Imported by: 0

Documentation

Overview

This file handles generating redirect HTML pages for URL aliases. Aliases allow old URLs to redirect to new canonical page locations.

This file handles copying static assets from static/ to the output directory, with support for minification and SCSS compilation.

Generic taxonomy page generation for tags, categories, series, and custom taxonomies. Builds index pages and term pages with support for series ordering and navigation.

Package builder provides template loading and management.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AtomAuthor

type AtomAuthor struct {
	Name  string `xml:"name"`
	Email string `xml:"email,omitempty"`
}

AtomAuthor represents the author information in an Atom feed.

type AtomEntry

type AtomEntry struct {
	Title     string `xml:"title"`
	ID        string `xml:"id"`
	Updated   string `xml:"updated"`
	Published string `xml:"published"`
	Summary   string `xml:"summary,omitempty"`
	Content   struct {
		Type string `xml:"type,attr"`
		Data string `xml:",cdata"`
	} `xml:"content"`
	Links      []AtomLink `xml:"link"`
	Categories []string   `xml:"category,omitempty"`
}

AtomEntry represents a single entry in an Atom feed.

type AtomFeed

type AtomFeed struct {
	XMLName xml.Name    `xml:"http://www.w3.org/2005/Atom feed"`
	Title   string      `xml:"title"`
	ID      string      `xml:"id"`
	Updated string      `xml:"updated"`
	Author  *AtomAuthor `xml:"author,omitempty"`
	Links   []AtomLink  `xml:"link"`
	Entries []AtomEntry `xml:"entry"`
}

AtomFeed represents an Atom XML feed structure.

type AtomLink struct {
	Rel  string `xml:"rel,attr,omitempty"`
	Href string `xml:"href,attr"`
}

AtomLink represents a link in an Atom feed entry.

type Builder

type Builder struct {
	// contains filtered or unexported fields
}

func NewBuilder

func NewBuilder(site *config.Site, parser *parser.ContentParser) (*Builder, error)

NewBuilder creates a new Builder with loaded templates.

func (*Builder) CopyStaticFile added in v0.0.33

func (b *Builder) CopyStaticFile(srcPath string) error

CopyStaticFile copies a single static file from static/ to the output directory

func (*Builder) Generate

func (b *Builder) Generate(contentRoot *content.Node) error

Generate processes the content tree and generates the complete static site.

func (*Builder) GenerateClean added in v0.0.39

func (b *Builder) GenerateClean(contentRoot *content.Node) error

GenerateClean performs a full rebuild and cleans the output directory first. Use this after file deletions to remove stale content.

func (*Builder) GenerateWithOptions added in v0.0.32

func (b *Builder) GenerateWithOptions(contentRoot *content.Node, _ GenerateOptions) error

GenerateWithOptions processes the content tree with specific generation options. For backwards compatibility, this always performs a full build.

func (*Builder) ReloadTemplates

func (b *Builder) ReloadTemplates() error

ReloadTemplates reloads all templates from disk for development mode.

type GenerateOptions added in v0.0.32

type GenerateOptions struct {
	ContentDir        string
	OldTaxonomyValues map[string]map[string]any // Pre-snapshotted taxonomy values: relPath -> {field -> value}
}

GenerateOptions configures how the site generation should run.

type SearchEntry added in v0.1.0

type SearchEntry struct {
	ID          string   `json:"id"`
	Title       string   `json:"title"`
	Description string   `json:"description"`
	Content     string   `json:"content"`
	Tags        []string `json:"tags"`
	URL         string   `json:"url"`
	Date        string   `json:"date"`
}

SearchEntry represents a single document in the search index

type Sitemap

type Sitemap struct {
	XMLName xml.Name     `xml:"http://www.sitemaps.org/schemas/sitemap/0.9 urlset"`
	URLs    []SitemapURL `xml:"url"`
}

Sitemap represents an XML sitemap for search engines.

type SitemapURL

type SitemapURL struct {
	Loc        string `xml:"loc"`
	LastMod    string `xml:"lastmod,omitempty"`
	ChangeFreq string `xml:"changefreq,omitempty"`
	Priority   string `xml:"priority,omitempty"`
}

SitemapURL represents a single URL entry in a sitemap.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL