🐛 Fixed the post meta display hide when not values.

This commit is contained in:
凡梦星尘 2022-06-01 20:59:42 +08:00
parent bb77f9bfb6
commit 8609746b28
3 changed files with 4 additions and 3 deletions

View File

@ -1,5 +1,5 @@
{{- if .Site.Params.postMeta.categories }} {{- if .Site.Params.postMeta.categories }}
{{- if gt (len .Params.categories) 0 }} {{- if and .Params.categories (gt (len .Params.categories) 0) }}
<span class="post-meta-item"> <span class="post-meta-item">
<span class="post-meta-item-icon"> <span class="post-meta-item-icon">
<i class="far fa-folder-open"></i> <i class="far fa-folder-open"></i>

View File

@ -1,5 +1,6 @@
{{- if .Site.Params.postMeta.created }} {{- if .Site.Params.postMeta.created }}
{{ $createdTime := .PublishDate.Format .Site.Params.timeFormat }} {{ $timeF := .Site.Params.timeFormat }}
{{ $createdTime := (.Date.Format $timeF) | default (.PublishDate.Format $timeF) }}
<span class="post-meta-item"> <span class="post-meta-item">
<span class="post-meta-item-icon"> <span class="post-meta-item-icon">
<i class="far fa-calendar"></i> <i class="far fa-calendar"></i>

View File

@ -1,5 +1,5 @@
{{- if and .Site.Params.postMeta.updated.enable .Site.Params.postMeta.updated.anotherDay }} {{- if and .Site.Params.postMeta.updated.enable .Site.Params.postMeta.updated.anotherDay }}
{{- if gt .Lastmod .PublishDate }} {{- if and .Lastmod (gt .Lastmod .PublishDate) }}
{{ $modTime := .Lastmod.Format .Site.Params.timeFormat }} {{ $modTime := .Lastmod.Format .Site.Params.timeFormat }}
<span class="post-meta-item"> <span class="post-meta-item">
<span class="post-meta-item-icon"> <span class="post-meta-item-icon">