scaffold

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2026 License: MIT Imports: 7 Imported by: 0

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

func ParseContentPath(path string) (section, slug string)

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

func SlugToTitle(slug string) string

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.

Jump to

Keyboard shortcuts

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