diff --git a/exampleSite/hugo.toml b/exampleSite/hugo.toml index 85e39f0a..d60e9cc2 100644 --- a/exampleSite/hugo.toml +++ b/exampleSite/hugo.toml @@ -87,6 +87,7 @@ defaultContentLanguage = 'en' editPage = true # enable 'Edit this page' feature - default false lastMod = true # enable 'Last modified' date on pages - default false lastModRelative = true # format 'Last modified' time as relative - default true + useLastmodTime = false # use lastmod time for content or fallback to git info - default false sidebarIcons = true # enable sidebar icons? default false breadcrumbs = true # default is true diff --git a/layouts/partials/docs/gitinfo.html b/layouts/partials/docs/gitinfo.html index 5b53df7c..e0a17a9d 100644 --- a/layouts/partials/docs/gitinfo.html +++ b/layouts/partials/docs/gitinfo.html @@ -22,25 +22,35 @@ {{ if .Site.Params.docs.editPage | default false -}}
{{ end }} {{ if .Site.Params.docs.lastMod | default false -}}Last updated - {{ dateFormat "02 Jan 2006, 15:04 MST" .GitInfo.AuthorDate }} - . +
Last updated + + {{- if .Params.lastmod -}} + {{ dateFormat "02 Jan 2006, 15:04 MST" .Params.lastmod }} + {{- else if and (.Site.Params.docs.useLastmodTime | default false) (.Lastmod) -}} + {{ dateFormat "02 Jan 2006, 15:04 MST" .Lastmod }} + {{- else -}} + {{ dateFormat "02 Jan 2006, 15:04 MST" .GitInfo.AuthorDate }} + {{- end -}} + .