support lastmod

This commit is contained in:
Joel Beckmeyer 2024-06-29 13:27:32 -04:00
parent 9b3ec3d024
commit 765fe2068d

View File

@ -3,7 +3,25 @@
<article> <article>
<header> <header>
<h1>{{ .Title }}</h1> <h1>{{ .Title }}</h1>
{{ if .Date }}<time datetime="{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}">{{ .Date.Format "January 02, 2006" }}</time>{{ end }} <!-- Created Date -->
{{- $pubdate := .PublishDate.Format "January 02, 2006" }}
Created:
<time datetime="{{ .PublishDate }}" title="{{ .PublishDate }}">
{{ $pubdate }}
</time>
<!-- Last Updated Date -->
{{- if .Lastmod }}
{{- $lastmod := .Lastmod.Format "January 02, 2006" }}
{{- if ne $lastmod $pubdate }}
<div class="post-info-last-mod">
(Updated:
<time datetime="{{ .Lastmod }}" title="{{ .Lastmod }}">
{{ $lastmod }}
</time>)
</div>
{{- end }}
{{- end }}
</header> </header>
{{ .Content }} {{ .Content }}
</article> </article>