mirror of
https://github.com/CaiJimmy/hugo-theme-stack.git
synced 2024-11-23 10:21:46 +01:00
fix(article): frontmatter field .ReadingTime
should overwrite global configuration (#710)
This commit is contained in:
parent
30e033c660
commit
5d34c3de44
1 changed files with 6 additions and 3 deletions
|
@ -23,9 +23,12 @@
|
|||
{{ end }}
|
||||
</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">
|
||||
{{ if not .Date.IsZero }}
|
||||
{{ if $showDate }}
|
||||
<div>
|
||||
{{ partial "helper/icon" "date" }}
|
||||
<time class="article-time--published">
|
||||
|
@ -34,7 +37,7 @@
|
|||
</div>
|
||||
{{ end }}
|
||||
|
||||
{{ if (.Params.readingTime | default (.Site.Params.article.readingTime)) }}
|
||||
{{ if $showReadingTime }}
|
||||
<div>
|
||||
{{ partial "helper/icon" "clock" }}
|
||||
<time class="article-time--reading">
|
||||
|
|
Loading…
Reference in a new issue