fix(article): frontmatter field .ReadingTime
should overwrite global configuration (#710)
This commit is contained in:
parent
30e033c660
commit
5d34c3de44
@ -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">
|
||||||
|
Loading…
Reference in New Issue
Block a user