Documentation
¶
Index ¶
- func ToSlug(s string) string
- type Entity
- func (e *Entity) GetBool(key string) bool
- func (e *Entity) GetFAQs() []FAQ
- func (e *Entity) GetFloat(key string) float64
- func (e *Entity) GetIngredients() []string
- func (e *Entity) GetInstructions() []string
- func (e *Entity) GetInt(key string) int
- func (e *Entity) GetString(key string) string
- func (e *Entity) GetStringSlice(key string) []string
- func (e *Entity) HasField(key string) bool
- type FAQ
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Entity ¶
type Entity struct {
Slug string
SourceFile string
Fields map[string]interface{}
Sections map[string]interface{} // section name -> content ([]string for lists, []FAQ for faqs, string for markdown)
Body string // raw markdown body (minus frontmatter)
}
Entity is a generic content item with map-based fields and parsed body sections.
func (*Entity) GetIngredients ¶
GetIngredients returns the ingredients section as []string.
func (*Entity) GetInstructions ¶
GetInstructions returns the instructions section as []string.
func (*Entity) GetString ¶
GetString returns a string field value, or empty string if not found/not a string.
func (*Entity) GetStringSlice ¶
GetStringSlice returns a []string field value, or nil if not found/wrong type.
Click to show internal directories.
Click to hide internal directories.