Add lastmod to post

This commit is contained in:
zwbetz 2019-04-14 21:24:47 -05:00
parent 3894ae6990
commit 90caaa368c
3 changed files with 14 additions and 1 deletions

View File

@ -5,6 +5,7 @@ title = "Cupper"
theme = "cupper-hugo-theme"
googleAnalytics = "UA-123456789-1"
disqusShortname = "yourdiscussshortname"
enableGitInfo = true
[taxonomies]
tag = "tags"

View File

@ -5,6 +5,7 @@ title: Cupper
theme: cupper-hugo-theme
googleAnalytics: UA-123456789-1
disqusShortname: yourdiscussshortname
enableGitInfo: true
taxonomies:
tag: tags

View File

@ -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" . }}