Choose Where Hugo Gets a Page's Last-Modified Date

An “updated” date is only useful when it means something. Hugo can read it from front matter or Git history, but those sources answer different questions.

Manual Date Management

Set date and lastmod in front matter when you want editorial control over both values:

---
title: Advanced Web Development Techniques
date: 2024-01-15T09:00:00+00:00
lastmod: 2024-01-26T14:30:00+00:00
url: /web-development-guide/
---

This is the approach I prefer for articles. A spelling correction does not necessarily deserve a new visible date, while a substantial technical revision does. The author can make that distinction; a file timestamp cannot.

In the template, show “Updated” only when lastmod is later than date. Otherwise the repeated date adds noise.

Git-Based Date Tracking

Git history is useful when manually maintaining lastmod is unrealistic. Enable Git information and tell Hugo which sources should take priority:

enableGitInfo = true

[frontmatter]
  lastmod = ["lastmod", ":git", "date", "publishDate"]

Here Hugo first uses an explicit lastmod, then the relevant Git timestamp, followed by date and publishDate.

The tradeoff is that any committed change can move the Git-derived date, including formatting or metadata maintenance. For documentation that may be fine. For a public article, I would keep explicit dates authoritative and use Git only as a fallback.