Added conditional check - if there is no date, do not display content date in the list view.

This commit is contained in:
Adam Ormsby 2019-11-10 13:42:29 +07:00
parent e5ff39d0de
commit 8759dd6b38

View File

@ -13,9 +13,11 @@
<div class="post on-list"> <div class="post on-list">
<h1 class="post-title"><a href="{{ .Permalink }}">{{ .Title | markdownify }}</a></h1> <h1 class="post-title"><a href="{{ .Permalink }}">{{ .Title | markdownify }}</a></h1>
<div class="post-meta"> <div class="post-meta">
{{ if .Date }}
<span class="post-date"> <span class="post-date">
{{ .Date.Format ($.Site.Params.DateFormatList | default "2006-01-02") }} {{ .Date.Format ($.Site.Params.DateFormatList | default "2006-01-02") }}
</span> </span>
{{ end }}
{{ with .Params.Author }}<span class="post-author">— {{ $.Site.Params.WrittenBy | default "Written by" }} {{ . }}</span>{{ end }} {{ with .Params.Author }}<span class="post-author">— {{ $.Site.Params.WrittenBy | default "Written by" }} {{ . }}</span>{{ end }}
{{ if $.Site.Params.ShowReadingTime }} {{ if $.Site.Params.ShowReadingTime }}
<span class="post-read-time">— {{ .ReadingTime }} {{ $.Site.Params.MinuteReadingTime | default "min read" }}</span> <span class="post-read-time">— {{ .ReadingTime }} {{ $.Site.Params.MinuteReadingTime | default "min read" }}</span>