Back to

Package frontmatter

Latest Go to latest

The latest major version is .

Published: Aug 14, 2020 | License: MIT | Module:


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.


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) (goldsmith.Filter, error)

func (*FrontMatter) Name

func (*FrontMatter) Name() string

func (*FrontMatter) Process

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

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier