Overview

Frontmatter (or front matter) is metadata for a page.

Predefined Frontmatter

These predefined variables can be called from Page Variables. This list is incomplete:

  • aliases — an array of aliases that are published paths of renamed content that will be recreated in the output directory structure (see also: Aliases)
  • date — the datetime assigned to this page
  • description — a description of the page
  • draft — if true, hugo will not publish unless --buildDrafts is passed
  • expiryDate — if in the past, hugo will not publish unless --buildExpired is passed
  • images — an array of paths to images related to this page
  • keywords — the meta keywords for this content
  • lastmod — the datetime at which content was last modified
  • linkTitle — if set, Hugo defaults to using the linkTitle before the title (see also: Order lists of content by linktitle)
  • outputs — specify the output formats (see also: Output formats)
  • publishDate — if in the future, hugo will not publish unless --buildFuture is passed
  • slug — overrides the last segment of the URL path (see also: URL management)
  • type — the type of the content; derived from the directory (the section) if nto specified here (see also: Sections)
  • url — overrides the URL path; works for both regular pages and sections (see also: URL management)
  • weight — specify weight to order content in lists

User-defined Frontmatter

User-defined frontmatter fields can be added. They are placed into a single .Params variable for use in templates.

Example:

include_toc = true
show_comments = false

The above fields can be accessed via .Params.include_toc and Params.show_comments.