diff options
author | zwbetz <zwbetz@gmail.com> | 2019-04-15 05:24:47 +0300 |
---|---|---|
committer | zwbetz <zwbetz@gmail.com> | 2019-04-15 05:24:47 +0300 |
commit | 90caaa368c638ad12e77775152abf986727b9c71 (patch) | |
tree | c8424c10f77803524f2da48525569ded09894096 | |
parent | 3894ae69903811c60a0e32c1b041c18a474cef87 (diff) |
Add lastmod to post
-rw-r--r-- | exampleSite/config.toml | 1 | ||||
-rw-r--r-- | exampleSite/config.yaml | 1 | ||||
-rw-r--r-- | layouts/post/single.html | 13 |
3 files changed, 14 insertions, 1 deletions
diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 1bd0698..2110a56 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -5,6 +5,7 @@ title = "Cupper" theme = "cupper-hugo-theme" googleAnalytics = "UA-123456789-1" disqusShortname = "yourdiscussshortname" +enableGitInfo = true [taxonomies] tag = "tags" diff --git a/exampleSite/config.yaml b/exampleSite/config.yaml index b24cc8e..23e2ac8 100644 --- a/exampleSite/config.yaml +++ b/exampleSite/config.yaml @@ -5,6 +5,7 @@ title: Cupper theme: cupper-hugo-theme googleAnalytics: UA-123456789-1 disqusShortname: yourdiscussshortname +enableGitInfo: true taxonomies: tag: tags diff --git a/layouts/post/single.html b/layouts/post/single.html index 3374cf4..75191c1 100644 --- a/layouts/post/single.html +++ b/layouts/post/single.html @@ -6,10 +6,19 @@ </svg> {{ .Title }} </h1> + <div class="date"> {{ $dateFormat := $.Site.Params.dateFormat | default "Jan 2, 2006" }} - <strong aria-hidden="true">Publish date: </strong>{{ .PublishDate.Format $dateFormat }} + {{ $publishDate := .PublishDate }} + <strong aria-hidden="true">Publish date: </strong>{{ $publishDate.Format $dateFormat }} + {{ with .Lastmod }} + {{ if gt . $publishDate }} + <br> + <strong aria-hidden="true">Last mod date: </strong>{{ .Format $dateFormat }} + {{ end }} + {{ end }} </div> + {{ with .Params.tags }} <div class="tags"> <strong aria-hidden="true">Tags: </strong> @@ -26,9 +35,11 @@ </ul> </div> {{ end }} + {{ if ne .Params.toc false }} {{ partial "toc" . }} {{ end }} + {{ .Content }} </main> {{ partial "disqus.html" . }} |