summaryrefslogtreecommitdiff
path: root/layouts
diff options
context:
space:
mode:
authorThiago Perrotta <tbperrotta@gmail.com>2022-01-21 13:28:25 -0500
committerGitHub <noreply@github.com>2022-01-21 23:58:25 +0530
commitb0ab8ea4959c07fe13c1667297e986e1d65aafe1 (patch)
treeb0da1d5130c06f2e3733ef64660cd4dea284d843 /layouts
parent37f359ee2149abe147bba0a7dd4e1ff775dc2a56 (diff)
Add option to add word count to metadata (#740)
Usage: ShowWordCount: true
Diffstat (limited to 'layouts')
-rw-r--r--layouts/partials/post_meta.html4
1 files changed, 4 insertions, 0 deletions
diff --git a/layouts/partials/post_meta.html b/layouts/partials/post_meta.html
index 9225f13..f7134fb 100644
--- a/layouts/partials/post_meta.html
+++ b/layouts/partials/post_meta.html
@@ -8,6 +8,10 @@
{{- $scratch.Add "meta" (slice (i18n "read_time" .ReadingTime | default (printf "%d min" .ReadingTime))) }}
{{- end }}
+{{- if (.Param "ShowWordCount") -}}
+{{- $scratch.Add "meta" (slice (i18n "words" .WordCount | default (printf "%d words" .WordCount))) }}
+{{- end }}
+
{{- with (partial "author.html" .) }}
{{- $scratch.Add "meta" (slice .) }}
{{- end }}