Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MakeStanza ¶
func MakeStanza(fmt FrontMatterType, ctx context.Context) (stanza string)
func UnmarshalFrontMatter ¶ added in v0.5.0
func UnmarshalFrontMatter(data []byte, matterType FrontMatterType) (matter context.Context, err error)
Types ¶
type FrontMatterType ¶
type FrontMatterType string
const ( TomlMatter FrontMatterType = "toml" JsonMatter FrontMatterType = "json" YamlMatter FrontMatterType = "yaml" NoneMatter FrontMatterType = "none" )
func ParseContent ¶
func ParseContent(raw string) (matter, content string, matterType FrontMatterType)
type PageMatter ¶
type PageMatter struct { Origin string Path string Shasum string Body string Matter clContext.Context Locale language.Tag Created time.Time Updated time.Time FrontMatter string FrontMatterType FrontMatterType Stub interface{} }
func NewPageMatter ¶
func NewPageMatter(origin string, path, body string, frontMatterType FrontMatterType, matter clContext.Context) (pm *PageMatter)
func ParsePageMatter ¶
func (*PageMatter) Bytes ¶
func (pm *PageMatter) Bytes() (data []byte, err error)
Bytes rebuilds the page matter's file data, overriding FrontMatter with the Matter content, in the FrontMatterType format
func (*PageMatter) Copy ¶
func (pm *PageMatter) Copy() (copied *PageMatter)
func (*PageMatter) DecodeJsonBody ¶
func (pm *PageMatter) DecodeJsonBody() (data clContext.Context, err error)
DecodeJsonBody decodes the .Body from JSON and returns the context data
func (*PageMatter) DecodeJsonBodyWith ¶
func (pm *PageMatter) DecodeJsonBodyWith(v interface{}) (err error)
Click to show internal directories.
Click to hide internal directories.