Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewContent ¶
func NewContent(opts NewContentOptions) (string, error)
NewContent creates a new content file from an archetype template.
func ParseContentPath ¶
ParseContentPath splits "posts/my-slug" into (section, slug). For "about" with no slash, returns ("", "about"). For "docs/guide/intro", returns ("docs/guide", "intro").
func SlugToTitle ¶
SlugToTitle converts "my-great-idea" to "My Great Idea".
Types ¶
type ArchetypeVars ¶
type ArchetypeVars struct {
Title string // "My Great Idea"
Date string // RFC3339 timestamp
Section string // "posts"
Slug string // "my-great-idea"
}
ArchetypeVars are the variables available in archetype templates.
type NewContentOptions ¶
type NewContentOptions struct {
ContentDir string // e.g., "content"
ArchetypesDir string // e.g., "archetypes"
Path string // e.g., "posts/my-great-idea"
}
NewContentOptions holds parameters for content scaffolding.
Click to show internal directories.
Click to hide internal directories.