Skip to content

Commit

Permalink
fix readingTime
Browse files Browse the repository at this point in the history
  • Loading branch information
al6nlee committed Sep 5, 2024
1 parent 175d008 commit 90bf9c8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion layouts/posts/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,9 @@ <h2 class="single-subtitle">{{ . }}</h2>
{{ partial "plugin/fontawesome.html" (dict "Style" "solid" "Icon" "pencil-alt") }}&nbsp;{{ T "wordCount" .WordCount }}&nbsp;
{{- end -}}
{{- if $params.enableReadingTime | default true -}}
{{ partial "plugin/fontawesome.html" (dict "Style" "regular" "Icon" "clock") }}&nbsp;{{ T "readingTime" .ReadingTime }}&nbsp;
{{ $reading_speed := .Site.Params.reading_speed | default 228 -}}
{{ $readingTime := int (math.Ceil (div (float .WordCount) $reading_speed)) }}
{{ partial "plugin/fontawesome.html" (dict "Style" "regular" "Icon" "clock") }}&nbsp;{{ T "readingTime" $readingTime }}&nbsp;
{{- end -}}
{{- $comment := .Scratch.Get "comment" | default dict -}}
{{- /* Visitor Count */ -}}
Expand Down

0 comments on commit 90bf9c8

Please sign in to comment.