Developer Programs

Learn

Docs

Front Matter

Formatting your Content > Front Matter
Hugo
Hugo
configuration
configuration
content
content

Hugo allows you to tag each content page with metadata about the page, using what they call front matter.

Hugo front matter is a small text block found at the top of the file, delimited by dashed lines.

The jhDocs theme uses the following front matter settings in particular:

  • title: This is the title displayed at the top of the page and in the nav bar.
    • You must define a title for every page.
    • Example: title: 'Front Matter'
  • weight: This is an optional number used to override the sorting that Hugo performs when listing out your navigation elements.
    • By default, Hugo sorts each folder’s nav elements first numerically by weight, then alphabetically by title.
    • Any pages that don’t have a weight assigned will be listed (alphabetically) after those pages that do have a weight assigned.
    • You don’t have to assign a weight to every page. In fact, you don’t have to assign a weight to any page. You only assign a weight if you want to change its location in the navigation, relative to the other files in the same content folder.
    • Example: weight: 2
  • icon: Specifies which icon to display next to this page’s title in the navigation bar for top-level pages.
    • Specify an icon name from the icons page.
    • If you don’t specify an icon for a top-level page, the nav bar will display a generic document icon for the page.
    • Example: icon: alarm-clock
  • topics: This is an optional string that contains a comma-delimited list of high-level topics covered in this page.
    • Each topic displays as a button below the title. Pressing any topic button performs a site search for that topic.
    • You can see an example of topic buttons at the top of this page.
    • Example: topics: 'Hugo,configuration,content'
  • headerBefore: This is an optional string text that, if set, displays as a header above this page’s entry in the navigation bar.
  • hidden: This is an optional boolean used to hide a hidden page from the nav and site search.
    • Sometimes a page in your doc needs to be hidden, i.e. it should no longer show up in your site nav or search, but still needs to stay in the site in case someone has a link to that page that you want to preserve.
    • Simply add hidden: true to any page’s front matter to hide it from the nav and site search, while still keeping the page available in the site.

There may be additional front matter elements that you define in your site’s pages, but the ones described here are used in jhDocs Hugo sites.

The front matter from the 'Formatting your Content' page in this site
---
title: 'Formatting your Content'
icon: form
weight: 4
topics: 'content'
---

page content starts here...
Next topic: Banner

Support options
Have questions on this topic?
Join the jhDocs team in Microsoft Teams to connect with the community.
See something in this page that needs to change?
Send us feedback on this page.

Did this page help you?

Last updated Mon Dec 29 2025