In Hugo, you can automatically add the last updated date to articles by simply adding enableGitInfo = true
to config.toml
and building the site.
# config.toml
baseURL = "https://shou2017.com"
title = "My Blog"
enableRobotsTXT = true
enableEmoji = true
enableGitInfo = true # Automatically fetch the last updated date from Git history
theme = "hugo-theme-even"