mirror of
https://github.com/jbowdre/runtimeterror.git
synced 2024-11-09 17:42:19 +00:00
display lastmod date on single sidebar and archive list
This commit is contained in:
parent
c313ba8c05
commit
d8eaad0f0c
2 changed files with 7 additions and 4 deletions
|
@ -12,11 +12,13 @@
|
|||
</header>
|
||||
|
||||
{{ range $pages }}
|
||||
{{- $postDate := .Date.Format "2006-01-02" }}
|
||||
{{- $updateDate := .Lastmod.Format "2006-01-02" }}
|
||||
<article class="post">
|
||||
<header class="post__header">
|
||||
<h1><a href="{{ .Permalink }}">{{ .Title | markdownify }}</a></h1>
|
||||
<p class="post__meta">
|
||||
<span class="date">{{ .Date.Format "2 January 2006" }}</span>
|
||||
<span class="date">{{ $postDate }}{{- if ne $postDate $updateDate }} [{{ $updateDate }}]{{ end }}</span>
|
||||
</p>
|
||||
</header>
|
||||
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
{{ if or (.Params.description) (.Params.author) (.Params.date) }}
|
||||
{{- $postDate := .Date.Format "2006-01-02" }}
|
||||
{{- $updateDate := .Lastmod.Format "2006-01-02" }}
|
||||
{{ if or (.Params.description) (.Params.date) }}
|
||||
{{ if .Params.description }}<p>{{ .Params.description }}</p>{{ end }}
|
||||
<p>
|
||||
{{ if .Params.author }}By {{ .Params.author }}{{ if .Date }}, {{ end }}{{ end }}
|
||||
{{ if .Date }}{{ .Date.Format "2006-01-02" }}{{ end }}
|
||||
{{ with $postDate }}{{ . }}{{ end }}{{- if ne $postDate $updateDate }} [{{ $updateDate }}]{{ end }}
|
||||
</p>
|
||||
<p>
|
||||
{{- with .Params.tags -}}
|
||||
|
|
Loading…
Reference in a new issue