Documentation
¶
Overview ¶
Package frontmatter provides helpers for parsing and generating YAML frontmatter in markdown documents.
Index ¶
- Constants
- func Generate(values map[string]any, body string) (string, error)
- func GetBool(values map[string]any, key string) bool
- func GetString(values map[string]any, key string) string
- func GetStringSlice(values map[string]any, key string) []string
- func GetTime(values map[string]any, key string) time.Time
- func Parse(markdown string) (map[string]any, string, error)
- type Error
- type ErrorKind
Constants ¶
View Source
const (
// DateLayout matches the KB schema date fields.
DateLayout = "2006-01-02"
)
Variables ¶
This section is empty.
Functions ¶
func Generate ¶
Generate encodes frontmatter and prepends it to body. When values is empty, Generate returns body unchanged.
func GetStringSlice ¶
GetStringSlice returns the string slice value for key, or nil when missing.
Types ¶
Click to show internal directories.
Click to hide internal directories.