Documentation ¶
Index ¶
- func AddDateTimeLayout(layout string)
- func MakeFrontMatterStanza(fmt FrontMatterType, ctx context.Context) (stanza string)
- func ParseDateTime(value string) (t time.Time, err error)
- func ParseJson(content string) (m context.Context, err error)
- func ParseToml(content string) (m context.Context, err error)
- func ParseYaml(content string) (m context.Context, err error)
- type FrontMatterType
- type PageMatter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddDateTimeLayout ¶
func AddDateTimeLayout(layout string)
func MakeFrontMatterStanza ¶ added in v0.2.0
func MakeFrontMatterStanza(fmt FrontMatterType, ctx context.Context) (stanza string)
Types ¶
type FrontMatterType ¶
type FrontMatterType string
const ( TomlMatter FrontMatterType = "toml" JsonMatter FrontMatterType = "json" YamlMatter FrontMatterType = "yaml" NoneMatter FrontMatterType = "none" )
func ParseFrontMatterContent ¶
func ParseFrontMatterContent(raw string) (matter, content string, matterType FrontMatterType)
type PageMatter ¶
type PageMatter struct { Origin string Path string Shasum string Body string Matter beContext.Context Locale language.Tag Created time.Time Updated time.Time FrontMatter string FrontMatterType FrontMatterType Stub interface{} }
func NewPageMatter ¶ added in v0.2.0
func NewPageMatter(origin string, path, body string, frontMatterType FrontMatterType, matter beContext.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) DecodeJsonBody ¶ added in v0.2.2
func (pm *PageMatter) DecodeJsonBody() (data beContext.Context, err error)
DecodeJsonBody decodes the .Body from JSON and returns the context data
func (*PageMatter) DecodeJsonBodyWith ¶ added in v0.2.2
func (pm *PageMatter) DecodeJsonBodyWith(v interface{}) (err error)
Click to show internal directories.
Click to hide internal directories.