mirror of
https://github.com/theNewDynamic/gohugo-theme-ananke.git
synced 2025-06-08 00:52:43 +00:00
Support reading_speed language param in single.html
Signed-off-by: D14rn <49399494+D14rn@users.noreply.github.com>
This commit is contained in:
parent
40c8d5f5ee
commit
857633572e
@ -43,7 +43,14 @@
|
|||||||
3) A page front matter value is set `show_reading_time = true`
|
3) A page front matter value is set `show_reading_time = true`
|
||||||
*/}}
|
*/}}
|
||||||
{{ if (or (eq (.Param "show_reading_time") true) (eq $section.Params.show_reading_time true) )}}
|
{{ if (or (eq (.Param "show_reading_time") true) (eq $section.Params.show_reading_time true) )}}
|
||||||
<span class="f6 mv4 dib tracked"> - {{ i18n "readingTime" .ReadingTime }} </span>
|
{{ $readingTime := .ReadingTime }}
|
||||||
|
|
||||||
|
{{ with .Site.Params.reading_speed }}
|
||||||
|
{{ $readingTime = div (float $.WordCount) . }}
|
||||||
|
{{ $readingTime = math.Ceil $readingTime }}
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
|
<span class="f6 mv4 dib tracked"> - {{ i18n "readingTime" (int $readingTime) }} </span>
|
||||||
<span class="f6 mv4 dib tracked"> - {{ i18n "wordCount" .WordCount }} </span>
|
<span class="f6 mv4 dib tracked"> - {{ i18n "wordCount" .WordCount }} </span>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</header>
|
</header>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user