Add word count

This commit is contained in:
Will Faught
2025-02-08 22:55:42 -08:00
parent 394cfb9d93
commit a25facfe27
20 changed files with 81 additions and 1 deletions

View File

@@ -17,6 +17,7 @@
{{ $tags := $page.GetTerms "tags" }}
{{ $time := $page.ReadingTime | and ($page.Parent.Param "paige.subpages.disable_reading_time" | not) }}
{{ $title := $page.LinkTitle | markdownify | plainify | htmlUnescape | and ($page.Parent.Param "paige.subpages.disable_title" | not) }}
{{ $words := $page.WordCount | and ($page.Parent.Param "paige.subpages.disable_word_count" | not) }}
{{ if $draft }}
{{ $flags = $flags | append "paige-draft" "paige-unpublished" }}
@@ -104,6 +105,10 @@
</p>
{{ end }}
{{ with $words }}
<p class="paige-page-word-count paige-row-short text-center text-secondary">{{ . }} {{ i18n "paige_words" . }}</p>
{{ end }}
{{ with $time }}
<p class="paige-page-reading-time paige-row-short text-center text-secondary">{{ . }} {{ i18n "paige_minutes" . }}</p>
{{ end }}