support lastmod
This commit is contained in:
parent
9b3ec3d024
commit
ba427a30a7
@ -3,7 +3,25 @@
|
||||
<article>
|
||||
<header>
|
||||
<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 gt .Lastmod .PublishDate }}
|
||||
<div class="post-info-last-mod">
|
||||
(Updated:
|
||||
<time datetime="{{ .Lastmod }}" title="{{ .Lastmod }}">
|
||||
{{ $lastmod }}
|
||||
</time>)
|
||||
</div>
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
</header>
|
||||
{{ .Content }}
|
||||
</article>
|
||||
|
Loading…
Reference in New Issue
Block a user