Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Metadata ¶ added in v0.4.0
type Metadata struct { Title string `yaml:"title" toml:"title" json:"title" org:"title"` IsDraft bool `yaml:"draft" toml:"draft" json:"draft" org:"draft"` Layout string `yaml:"layout" toml:"layout" json:"layout" org:"layout"` Date time.Time `yaml:"date" toml:"date" json:"date" org:"date"` Summary string `yaml:"summary" toml:"summary" json:"summary" org:"summary"` IsHeadless bool `yaml:"headless" toml:"headless" json:"headless" org:"headless"` }
Metadata contains all recognized Hugo properties.
func ParseMetadata ¶ added in v0.4.0
ParseMetadata extracts TOML/JSON/YAML/org-mode format front matter from Markdown text. If no metadata is found, markdown will be equal to source.
TOML front matter is identified as +++ symbols at the very start of the text, followed by TOML content, followed by another +++ (YAML is the same, but with ---). JSON front matter is identified as a JSON object followed by two newline symbols. org-mode front matter is identified as a set of #+KEY: VALUE lines, the first line started with anything else but #+ ends the front matter.
Click to show internal directories.
Click to hide internal directories.