I’ve read that .GitInfo might get me the “last modified” date for the site as a whole, but it sounds like enabling it might mess with already manually-specified dates in articles? I also don’t think Git is in my PATH (due to potential conflicts on Windows).
Is there a variable to get the build date/time for a Hugo site? (without Git)
I’m currently using the following to give me “Site last updated $Date” in my footer (when provided with a URL to a Git Repo or other build log in Site.Params.commit), but now
doesn’t get the correct date, always saying my site (theme) was last updated June 2022, despite having a bunch of articles from more recently
{{ if .Site.Params.commit }}
Site last updated: <a href="{{ .Site.Params.commit }}" target="_blank">{{ now.Format "06 June 2006" }}</a>
{{ end }}
PS. For future readers, this thread may also be relevant.