Documentation
¶
Overview ¶
Package content loads Markdown collections with YAML/TOML/JSON frontmatter.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RenderMarkdown ¶
RenderMarkdown converts Markdown to HTML using the package default engine.
func RenderMarkdownUnsafe ¶
RenderMarkdownUnsafe renders raw HTML for trusted-author content only.
Types ¶
type Document ¶
type Document[T any] struct { Collection string Slug string Path string // absolute path on disk Meta T Body string // HTML Raw string // Markdown body without frontmatter }
Document is a Markdown file with typed frontmatter and rendered HTML body.
type Options ¶
type Options struct {
UnsafeHTML bool
}
Options controls Markdown rendering. Raw HTML is escaped unless UnsafeHTML is explicitly set for trusted-author content.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store holds loaded collections from a content root directory.
func Load ¶
Load scans dir for content/<collection>/**/*.md and indexes them. dir itself is the content root (e.g. "./content").
func LoadWithOptions ¶
LoadWithOptions is Load with explicit Markdown rendering options.
func (*Store) Collections ¶
Collections returns sorted collection names.