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>
|
</header>
|
||||||
|
|
||||||
{{ range $pages }}
|
{{ range $pages }}
|
||||||
|
{{- $postDate := .Date.Format "2006-01-02" }}
|
||||||
|
{{- $updateDate := .Lastmod.Format "2006-01-02" }}
|
||||||
<article class="post">
|
<article class="post">
|
||||||
<header class="post__header">
|
<header class="post__header">
|
||||||
<h1><a href="{{ .Permalink }}">{{ .Title | markdownify }}</a></h1>
|
<h1><a href="{{ .Permalink }}">{{ .Title | markdownify }}</a></h1>
|
||||||
<p class="post__meta">
|
<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>
|
</p>
|
||||||
</header>
|
</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 }}
|
{{ if .Params.description }}<p>{{ .Params.description }}</p>{{ end }}
|
||||||
<p>
|
<p>
|
||||||
{{ if .Params.author }}By {{ .Params.author }}{{ if .Date }}, {{ end }}{{ end }}
|
{{ with $postDate }}{{ . }}{{ end }}{{- if ne $postDate $updateDate }} [{{ $updateDate }}]{{ end }}
|
||||||
{{ if .Date }}{{ .Date.Format "2006-01-02" }}{{ end }}
|
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
{{- with .Params.tags -}}
|
{{- with .Params.tags -}}
|
||||||
|
|
Loading…
Reference in a new issue