Hugo Front Matter
Here is an example front matter, which is like meta data for your content on this page.
Many of these are optional, but here is an example of toml format. You can also use yaml and it doesn’t matter if you use yaml or toml.
Example Front Matter
Here is an example of toml, but you can also do yaml. Yaml starts with — and toml starts with +++
+++
title = "Example Title"
date = 2024-01-21T09:00:00+00:00
lastmod = 2024-01-21T11:00:00+00:00
draft = false
author = "John Doe"
description = "A brief description of the content."
categories = ["Technology", "Hugo"]
tags = ["Web Development", "Static Sites"]
slug = "example-title"
url = "/post/example-title"
type = "post"
layout = "post"
weight = 1
images = ["/images/example1.jpg", "/images/example2.jpg"]
aliases = ["/old-url/", "/another-old-url/"]
+++
Then your markdown goes here
Explanation of Fields
NAME | DESCRIPTION |
---|---|
title | The title of your content. |
date | The creation date of the content. |
lastmod | The last modification date. |
draft | Indicates whether the content is a draft (true or false). |
author | The author’s name. |
description | A short summary of the content. |
categories | Broad groupings for the content. |
tags | Specific keywords related to the content. |
slug | A URL-friendly version of the title. |
url | Custom URL for the content. |
type | The type of content (e.g., blog, page). |
layout | The layout file to use for rendering. |
weight | Used for ordering content. |
images | Associated images for the content. |
aliases | Alternative URLs that redirect to this content. |