Frontmatter — Fields Reference

What is frontmatter?

Frontmatter is a YAML block at the top of each .md file between ---. Hugo reads it and makes it available in templates via .Params and built-in fields.

---
title: "Title"           # built-in field → .Title
date: 2026-04-11         # built-in field → .Date
my_param: "value"        # custom → .Params.my_param
---

Built-in Hugo fields (all content types)

FieldTypeTemplate accessDescription
titlestring.TitlePage title. Used in <title>, h1, breadcrumb, cards
datedate.DatePublication date. Format: 2026-04-11. Affects sorting
descriptionstring.DescriptionMeta description. Used in <meta description> and card previews
draftbool.Drafttrue — page not published with hugo (only with hugo -D)
tags[]string.Params.tagsTags. Create pages at /tags/{tag-name}/
categories[]string.Params.categoriesCategories. Create pages at /categories/{name}/
weightint.WeightManual sort order (lower = higher)

Fields for posts (content/posts/*.md)

Used in templates

FieldTypeRequiredUsed inDescription
titlestringyesh1, card, ToCArticle title
datedateyescard, sortingPublication date
descriptionstringrecommendedmeta, card, cert-pageShort description (1-2 sentences)
tags[]stringrecommendedpost-meta, filters, /tags/Article tags
categories[]stringnofilter in certs/single.htmlCategory (e.g. “LPIC-2”)
readingtimeintno.post-meta in single.htmlReading time in minutes

Example for an LPIC-2 article

---
title: "LPIC-2 200.1 — Measuring and Diagnosing Resource Usage"
date: 2026-04-10
description: "CPU, memory, disk I/O monitoring: top, vmstat, iostat, sar. LPIC-2 topic 200.1."
tags: ["Linux", "Performance", "LPIC-2", "Monitoring"]
categories: ["LPIC-2"]
---

How description is used in different places

LocationTemplateBehavior
Page meta tagbaseof.html.Description or .Site.Params.description
Card in listinglist.html.Description → if absent, .Summary (first 120 chars)
Link in cert accordioncerts/single.html.Description below the title
Pagefind search resultPagefindexcerpt from page content

Fields for cert pages (content/certs/*.md)

These are custom fields, read via .Params.* in certs/single.html.

FieldTypeRequiredDescription
titlestringyesCert name (e.g. “LPIC-2”)
cert_badgestringyesEmoji icon (e.g. “🖥️”)
cert_colorstringyesCSS color (hex). Used for --cert-color and border
descriptionstringyesSubtitle in hero block
post_prefixstringyesPrefix for matching posts by slug (e.g. "lpic2")
post_categorystringyesHugo category used in course posts (e.g. "LPIC-2"). Used by certs-widget.html to count articles
expected_articlesintnoPlanned total article count — enables auto-calculated progress % in the widget
progress_pctintnoManual fallback % when expected_articles is not set (e.g. early-stage courses with no articles yet)
exams[]ExamnoList of exams with topics. Without it — “coming soon” page

exams structure

exams:
  - code: "201"              # Exam code (string)
    title: "Advanced Linux"  # Exam name
    topics:
      - num: "200"           # Topic number (string!)
        title: "Capacity Planning"
      - num: "201"
        title: "Linux Kernel"

Important: num must be a string (without quotes YAML may interpret it as int). In the template it is used to build a pattern: "{post_prefix}-{num}-".

How post_prefix links posts to topics

post_prefix = "lpic2"
topic.num   = "200"
──────────────────────────────────────────────
Pattern: "lpic2-200-"

Matches:     lpic2-200-1-capacity-planning.md  ✓
             lpic2-200-2-predict-future.md      ✓
No match:    lpic2-201-1-kernel.md             ✗

This means the article file’s slug determines which topic it belongs to.


Fields for the About page (content/about.md)

about.md uses no custom frontmatter fields — profile data (name, links) comes from hugo.toml [params].

---
title: "About"
date: 2026-04-01
---

The .md body is rendered into .prose in about/single.html.


Fields for documentation (content/kb/docs/*.md)

---
title: "Page title"
date: 2026-04-11
description: "Description for meta"
page_lang: "en"
lang_pair: "/kb/docs/ru/frontmatter/"
tags: ["docs"]
---

Uses the standard _default/single.html with ToC sidebar.


Global site parameters (hugo.toml [params])

Available in templates as .Site.Params.*:

ParameterAccessUsed in
author.Site.Params.authorabout/single.html.about-name
description.Site.Params.descriptionbaseof.html<meta description> fallback
location.Site.Params.locationabout/single.html, footer
github.Site.Params.githubabout/single.html → GH link
linkedin.Site.Params.linkedinabout/single.html → LinkedIn link
telegram.Site.Params.telegramabout/single.html → Telegram link