mirror of
https://github.com/panr/hugo-theme-terminal.git
synced 2025-03-14 18:29:03 +03:00
Fix issue with lastmod being equal to date
This commit is contained in:
parent
26c75170e4
commit
2ee779d93b
2 changed files with 11 additions and 1 deletions
layouts
|
@ -8,7 +8,7 @@
|
|||
<time class="post-date">
|
||||
{{- partial "post-date" . -}}
|
||||
{{- if .Lastmod -}}
|
||||
[{{- partial "post-date" . (dict "Date" .Lastmod) -}}]
|
||||
[{{- partial "post-lastmod" . -}}]
|
||||
{{- end -}}
|
||||
</time>
|
||||
{{- end -}}
|
||||
|
|
10
layouts/partials/post-lastmod.html
Normal file
10
layouts/partials/post-lastmod.html
Normal file
|
@ -0,0 +1,10 @@
|
|||
{{- $date := .Lastmod -}}
|
||||
{{- with .Params.dateFormat -}}
|
||||
{{- $date | time.Format . -}}
|
||||
{{- else -}}
|
||||
{{- with .Site.Params.dateFormat -}}
|
||||
{{- $date | time.Format . -}}
|
||||
{{- else -}}
|
||||
{{- $date | time.Format "2006-01-02" -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
Loading…
Add table
Reference in a new issue