Common Front Matter Parameters Example

This article is used to demonstrate and explain a mostcommon used Front Matter configuration. The meanings of each field are as follows:

  1. Title and Path
  • title: Page title, used for <title> and the main heading in the body.
  • slug: Generates a friendly short link (together with permalinks determines the final URL).
  • canonical: Normalized link address. If content appears on multiple URLs, search engines use this as the primary one.
  • aliases: List of historical old links; automatically generates 301 redirects to protect existing external links and indexing.
  1. Time Metadata
  • date: Publication date; used for sorting and structured data's datePublished.
  • lastmod: Last update; used for structured data dateModified and SEO display.
  • publishDate / expiryDate: Scheduled publication/expiry; suitable for content with time-sensitive validity.
  1. Categories and Tags
  • categories: Article categories; used for archiving and navigation.
  • tags: Keyword tags; used for retrieval and related article recommendations.
  • series: Series articles; provides series navigation when the theme supports it.
  1. Author and Media
  • author: Author information; the theme can be used to display or structured data.
  • images: Prioritized as OpenGraph/Twitter share images; if unavailable, falls back to the site's favicon.
  1. Language and Internationalization
  • translationKey: Logical association key for multilingual articles; different filenames can also correctly identify each other.
  1. SEO Control
  • seo.robots: Controls crawling and indexing, such as index,follow or noindex,nofollow.
  • The site template will generate <meta name="description">, canonical, og:*, twitter:*, hreflang, and JSON-LD structured data based on the above fields.
  1. Other
  • draft: Draft; should be false in production environments.
  • weight: Weight; same-day content can be sorted using weight.
  • featured: Featured or recommended; the theme can use this field to enhance display priority.

The following is a sample of the body:

This is the body part of the complete Front Matter example. It is used to verify:

  • Whether OG/Twitter share images are effective (prioritizes images[0]).
  • Whether canonical links and hreflang are generated correctly.
  • Whether JSON-LD's datePublished and dateModified match date/lastmod.

Use the language switcher in the top-right corner to test the behavior of the multilingual translationKey (if an English version is provided).

What do you think?
0 Reactions
Pick a reaction
Hugo Guide: Series Post List
  • 01. Common Front Matter Parameters Example