index

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildCalendarData

func BuildCalendarData(pages []*content.Page) map[string][]CalendarEntry

BuildCalendarData builds the calendar data (does NOT write file). Returns a map from date string (YYYY-MM-DD) to list of entries.

func BuildCalendarJSON

func BuildCalendarJSON(pages []*content.Page, outputDir string) error

BuildCalendarJSON builds the calendar JSON at outputDir/calendar.json (backward compat wrapper).

func BuildGraphJSON

func BuildGraphJSON(pages []*content.Page, outputDir string) error

BuildGraphJSON builds the graph JSON at outputDir/graph.json (backward compat wrapper).

func BuildSearchJSON

func BuildSearchJSON(pages []*content.Page, outputDir string) error

BuildSearchJSON builds the search index JSON file at outputDir/en.search-data.json.

func BuildSitemap

func BuildSitemap(pages []*content.Page, baseURL, outputDir string) error

BuildSitemap generates sitemap.xml in outputDir.

func BuildTreeJSON

func BuildTreeJSON(pages []*content.Page, outputDir string) error

BuildTreeJSON builds the tree JSON at outputDir/tree.json (backward compat wrapper).

Types

type CalendarEntry

type CalendarEntry struct {
	URL   string `json:"url"`
	Title string `json:"title"`
	Path  string `json:"path"`
	Date  string `json:"date"`
	Hour  string `json:"hour"`
	Time  string `json:"time"`
	Words int    `json:"words"`
	RT    string `json:"rt"`
}

CalendarEntry is a single entry in the calendar data.

type GraphData

type GraphData struct {
	Nodes []GraphNode `json:"nodes"`
	Links []GraphLink `json:"links"`
}

GraphData is the full graph data structure (bipartite: page nodes + tag nodes).

func BuildGraphData

func BuildGraphData(pages []*content.Page) *GraphData

BuildGraphData builds the graph data structure (does NOT write file). Uses a bipartite model: each tag is its own node, links go page → tag node.

type GraphLink struct {
	Source string `json:"source"`
	Target string `json:"target"`
	Kind   string `json:"kind"` // "tree" | "tag"
}

GraphLink represents an edge in the knowledge graph.

type GraphNode

type GraphNode struct {
	ID       string   `json:"id"`
	URL      string   `json:"url"`
	Title    string   `json:"title"`
	Section  string   `json:"section"`
	Kind     string   `json:"kind"`
	Depth    int      `json:"depth"`
	Tags     []string `json:"tags"`
	ReadTime int      `json:"readTime"`
}

GraphNode represents a node in the knowledge graph.

type SearchEntry

type SearchEntry struct {
	Title string            `json:"title"`
	Data  map[string]string `json:"data"`
}

SearchEntry matches Hugo's search JSON output format. { "/path/": { "title": "Title", "data": { "": "plain text..." } } }

type TreeData

type TreeData struct {
	Items    []TreeItem `json:"items"`
	RootID   string     `json:"rootId"`
	RootName string     `json:"rootName"`
}

TreeData is the flat tree data structure with parent pointers.

func BuildTreeData

func BuildTreeData(pages []*content.Page) *TreeData

BuildTreeData builds the flat tree data structure (does NOT write file).

type TreeItem

type TreeItem struct {
	ID       string `json:"id"`
	Parent   string `json:"parent"`
	Name     string `json:"name"`
	Kind     string `json:"kind"`
	Section  string `json:"section"`
	Depth    int    `json:"depth"`
	ReadTime int    `json:"readTime"`
	URL      string `json:"url"`
	SubCount int    `json:"subCount"`
}

TreeItem is a flat node in the tree data structure.

Jump to

Keyboard shortcuts

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