Documentation

Overview

    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"
    Tags:
      - "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.

    Index

    Constants

    This section is empty.

    Variables

    This section is empty.

    Functions

    This section is empty.

    Types

    type FrontMatter

    type FrontMatter struct{}

      Frontmatter chainable plugin context.

      func New

      func New() *FrontMatter

        New creates a new instance of the Frontmatter plugin.

        func (*FrontMatter) Initialize

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

        func (*FrontMatter) Name

        func (*FrontMatter) Name() string

        func (*FrontMatter) Process

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

        Source Files