Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildCollectionIndex ¶
BuildCollectionIndex creates a schema.org CollectionPage index limit controls how many items to include (0 means no limit)
func SerializeJSONLD ¶
SerializeJSONLD serializes JSON-LD to formatted JSON
func SortDocumentsByDate ¶ added in v0.5.0
func SortDocumentsByDate(docs []*Document)
SortDocumentsByDate sorts documents by DatePublished descending (newest first), then by Title ascending for items with the same date
func ValidateFrontmatter ¶
func ValidateFrontmatter(fm Frontmatter) error
ValidateFrontmatter validates frontmatter against required fields
Types ¶
type Document ¶
type Document struct {
Frontmatter Frontmatter
Content string // Raw markdown content
HTML string // Rendered HTML
FilePath string // Path to the source file
}
Document represents a parsed markdown document
func ListDocuments ¶
ListDocuments finds all markdown documents in a directory
func ParseDocument ¶
ParseDocument parses a markdown file with YAML frontmatter
func ParseDocumentFromBytes ¶
ParseDocumentFromBytes parses markdown content with YAML frontmatter
type Frontmatter ¶
type Frontmatter struct {
Title string `yaml:"title" json:"title"`
Description string `yaml:"description,omitempty" json:"description,omitempty"`
DatePublished string `yaml:"datePublished" json:"datePublished"`
DateModified string `yaml:"dateModified,omitempty" json:"dateModified,omitempty"`
Author interface{} `yaml:"author" json:"author"`
Tags []string `yaml:"tags,omitempty" json:"tags,omitempty"`
Collection string `yaml:"collection,omitempty" json:"collection,omitempty"`
Lang string `yaml:"lang" json:"lang"`
Draft bool `yaml:"draft,omitempty" json:"draft,omitempty"`
Slug string `yaml:"slug,omitempty" json:"slug,omitempty"`
Image string `yaml:"image,omitempty" json:"image,omitempty"`
Keywords []string `yaml:"keywords,omitempty" json:"keywords,omitempty"`
}
Frontmatter represents the YAML frontmatter of a document