Documentation
¶
Index ¶
- func ApplyWorkflowToFrontMatter(fm *FrontMatter, status string, publishAt, unpublishAt *time.Time, note string)
- func AuthorArchiveURL(defaultLang, lang, author string) string
- func AuthorSlug(name string) string
- func BuildNewContent(cfg *config.Config, kind, slug string) (string, error)
- func BuildNewContentWithOptions(cfg *config.Config, opts NewContentOptions) (string, error)
- func NewWatcher() (*fsnotify.Watcher, error)
- func SearchPageURL(defaultLang, lang string) string
- type Document
- type FrontMatter
- type Hooks
- type Loader
- type NewContentOptions
- type SiteGraph
- type Workflow
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyWorkflowToFrontMatter ¶
func ApplyWorkflowToFrontMatter(fm *FrontMatter, status string, publishAt, unpublishAt *time.Time, note string)
func AuthorArchiveURL ¶
AuthorArchiveURL returns the canonical built-in author archive URL for a language-aware site.
func AuthorSlug ¶
AuthorSlug normalizes a human author name into the canonical segment used by Foundry's built-in author archive routes.
func BuildNewContentWithOptions ¶
func BuildNewContentWithOptions(cfg *config.Config, opts NewContentOptions) (string, error)
func NewWatcher ¶
func SearchPageURL ¶
SearchPageURL returns the canonical built-in search page URL for a language-aware site.
Types ¶
type Document ¶
type Document struct {
ID string
Type string
Lang string
IsDefault bool
Status string
Title string
Slug string
URL string
Layout string
SourcePath string
RelPath string
RawBody string
HTMLBody template.HTML
Summary string
Date *time.Time
CreatedAt *time.Time
UpdatedAt *time.Time
Draft bool
Author string
LastEditor string
Params map[string]any
Fields map[string]any
Taxonomies map[string][]string
}
type FrontMatter ¶
type FrontMatter struct {
Title string `yaml:"title"`
Slug string `yaml:"slug"`
Layout string `yaml:"layout"`
Draft bool `yaml:"draft"`
Summary string `yaml:"summary"`
Date *time.Time `yaml:"date"`
CreatedAt *time.Time `yaml:"created_at,omitempty"`
UpdatedAt *time.Time `yaml:"updated_at"`
Author string `yaml:"author,omitempty"`
LastEditor string `yaml:"last_editor,omitempty"`
Fields map[string]any `yaml:"fields"`
Tags []string `yaml:"tags"`
Categories []string `yaml:"categories"`
Taxonomies map[string][]string `yaml:"taxonomies"`
Params map[string]any `yaml:",inline"`
}
func ParseDocument ¶
func ParseDocument(src []byte) (*FrontMatter, string, error)
type Hooks ¶
type Hooks interface {
OnContentDiscovered(path string) error
OnFrontmatterParsed(*Document) error
OnMarkdownRendered(*Document) error
OnDocumentParsed(*Document) error
OnDataLoaded(map[string]any) error
OnGraphBuilding(*SiteGraph) error
OnGraphBuilt(*SiteGraph) error
OnTaxonomyBuilt(*SiteGraph) error
}
Hooks exposes the content-loading lifecycle to plugins and other integrators.
The hook order for a full load is:
- OnDataLoaded
- OnGraphBuilding
- For each discovered document: a. OnContentDiscovered b. OnFrontmatterParsed c. OnMarkdownRendered d. OnDocumentParsed
- OnTaxonomyBuilt
- OnGraphBuilt
Hook implementations may mutate Document and SiteGraph values, but should do so carefully because later phases depend on normalized data.
type Loader ¶
type Loader struct {
// contains filtered or unexported fields
}
Loader reads content files and data files from disk, normalizes them into Documents, and assembles the SiteGraph used by rendering and serving.