Documentation ¶
Index ¶
- Constants
- func HandleJSONMetaData(datum []byte) (map[string]interface{}, error)
- func HandleTOMLMetaData(datum []byte) (map[string]interface{}, error)
- func HandleYAMLMetaData(datum []byte) (map[string]interface{}, error)
- func URLEscape(uri string) (string, error)
- type Config
- type FrontmatterType
- type Page
- type PageMetadata
- type PathPattern
Constants ¶
const ( // HTMLLead identifies the start of HTML documents. HTMLLead = "<" // YAMLLead identifies the start of YAML frontmatter. YAMLLead = "-" // YAMLDelim identifies the YAML front matter delimiter. YAMLDelim = "---" // TOMLLead identifies the start of TOML front matter. TOMLLead = "+" // TOMLDelim identifies the TOML front matter delimiter. TOMLDelim = "+++" // JSONLead identifies the start of JSON frontmatter. JSONLead = "{" // HTMLCommentStart identifies the start of HTML comment. HTMLCommentStart = "<!--" // HTMLCommentEnd identifies the end of HTML comment. HTMLCommentEnd = "-->" // BOM Unicode byte order marker BOM = '\ufeff' )
Variables ¶
This section is empty.
Functions ¶
func HandleJSONMetaData ¶
HandleJSONMetaData unmarshals JSON-encoded datum and returns a Go interface representing the encoded data structure.
func HandleTOMLMetaData ¶
HandleTOMLMetaData unmarshals TOML-encoded datum and returns a Go interface representing the encoded data structure.
func HandleYAMLMetaData ¶
HandleYAMLMetaData unmarshals YAML-encoded datum and returns a Go interface representing the encoded data structure.
Types ¶
type FrontmatterType ¶
type FrontmatterType struct { // Parse decodes content into a Go interface. Parse func([]byte) (map[string]interface{}, error) // contains filtered or unexported fields }
FrontmatterType represents a type of frontmatter.
func DetectFrontMatter ¶
func DetectFrontMatter(mark rune) (f *FrontmatterType)
DetectFrontMatter detects the type of frontmatter analysing its first character.
type Page ¶
type Page interface { // FrontMatter contains the raw frontmatter with relevant delimiters. FrontMatter() []byte // Content contains the raw page content. Content() []byte // Body contains the full document. Body() []byte // IsRenderable denotes that the page should be rendered. IsRenderable() bool // Metadata returns the unmarshalled frontmatter data. Metadata() (map[string]interface{}, error) }
Page represents a parsed content page.
type PageMetadata ¶
type PathPattern ¶
type PathPattern string
PathPattern represents a string which builds up a URL from attributes
func (PathPattern) Expand ¶
func (pp PathPattern) Expand(m *PageMetadata) (string, error)
Expand on a PathPattern takes a Content and returns the fully expanded Permalink or an error explaining the failure.