goldsmith-components: Index | Files

package frontmatter

import ""

Package frontmatter extracts the metadata stored in your files. This metadata can include any information you want, but typically contains the page title, creation date, tags, layout template, and more. There are no requirements about what fields must be present; this is entirely up to you.

Title = "My homepage"
Tags = ["best", "page", "ever"]

Metadata in YAML format is enclosed by three minus (-) characters:

Title: "My homepage"
  - "best"
  - "page"
  - "ever"

Metadata in JSON format is enclosed by brace characters ({ and }):

    "Title": "My homepage",
    "Tags": ["best", "page", "ever"]

Normal page content immediately follows the metadata section. The metadata section is stripped after processed by this plugin.


Package Files


type FrontMatter Uses

type FrontMatter struct{}

Frontmatter chainable plugin context.

func New Uses

func New() *FrontMatter

New creates a new instance of the Frontmatter plugin.

func (*FrontMatter) Initialize Uses

func (*FrontMatter) Initialize(context *goldsmith.Context) (goldsmith.Filter, error)

func (*FrontMatter) Name Uses

func (*FrontMatter) Name() string

func (*FrontMatter) Process Uses

func (*FrontMatter) Process(context *goldsmith.Context, inputFile *goldsmith.File) error

Package frontmatter imports 10 packages (graph). Updated 2019-06-26. Refresh now. Tools for package owners.