Scripts: setup.sh, build.sh, serve.sh (Docker-based) Content: about, config, software, posts sections Custom: CSS overrides, HTML sitemap layout, extended_head partial Theme: hugo-theme-terminal via Hugo modules (go.mod)
929 B
929 B
| title | date | draft | tags | |||
|---|---|---|---|---|---|---|
| Automatic Dating with Git | 2026-04-02 | false |
|
Hugo can pull dates from Git history so you never have to update lastmod
by hand.
Enable Git info
# hugo.toml
enableGitInfo = true
Configure front matter date resolution
[frontmatter]
date = [':filename', ':default']
publishDate = [':filename', ':default']
lastmod = [':git', ':fileModTime']
How it works
.Date— tries the filename first (2026-04-03-post.md), then thedatefield in front matter..Lastmod— uses the Git author date of the last commit that touched the file, falling back to filesystem mtime..PublishDate— same resolution chain as.Date.
Filename date formats
Hugo recognizes these patterns:
2026-04-03-my-post.md → date: 2026-04-03, slug: my-post
2026-04-03T14-30-00-post.md → date: 2026-04-03T14:30:00