fix(article): frontmatter field .ReadingTime should overwrite global configuration

This commit is contained in:
Jimmy Cai 2022-10-29 12:47:07 +00:00
parent 86314608e3
commit 064fb60c91

View File

@ -23,9 +23,12 @@
{{ end }} {{ end }}
</div> </div>
{{ if or (not .Date.IsZero) (.Site.Params.article.readingTime) }} {{ $showReadingTime := .Params.readingTime | default (.Site.Params.article.readingTime) }}
{{ $showDate := not .Date.IsZero }}
{{ $showFooter := or $showDate $showReadingTime }}
{{ if $showFooter }}
<footer class="article-time"> <footer class="article-time">
{{ if not .Date.IsZero }} {{ if $showDate }}
<div> <div>
{{ partial "helper/icon" "date" }} {{ partial "helper/icon" "date" }}
<time class="article-time--published"> <time class="article-time--published">
@ -34,7 +37,7 @@
</div> </div>
{{ end }} {{ end }}
{{ if (.Params.readingTime | default (.Site.Params.article.readingTime)) }} {{ if $showReadingTime }}
<div> <div>
{{ partial "helper/icon" "clock" }} {{ partial "helper/icon" "clock" }}
<time class="article-time--reading"> <time class="article-time--reading">