aboutsummaryrefslogtreecommitdiff
path: root/layouts
diff options
context:
space:
mode:
authorMartin Kagamino Lehoux <martin@lehoux.net>2026-02-09 22:35:53 +0100
committerMartin Kagamino Lehoux <martin@lehoux.net>2026-02-10 05:07:11 +0100
commit563b48869cee85f345537cce09da0f991da46a9b (patch)
tree7d74a12495c95db577421e5e8c245b1a2186d62e /layouts
parent2ba2d3ad1547f7b3e30b94cc070f64f2940a66ca (diff)
Word count analysis
Diffstat (limited to 'layouts')
-rw-r--r--layouts/_default/home.wordstats.json11
-rw-r--r--layouts/_default/single.html2
2 files changed, 12 insertions, 1 deletions
diff --git a/layouts/_default/home.wordstats.json b/layouts/_default/home.wordstats.json
new file mode 100644
index 0000000..b227510
--- /dev/null
+++ b/layouts/_default/home.wordstats.json
@@ -0,0 +1,11 @@
+[
+{{- $pages := where site.RegularPages "Section" "posts" -}}
+{{- $first := true -}}
+{{- range $pages -}}
+{{- if not .Draft -}}
+{{- if not $first }},{{ end -}}
+{"title":{{ .Title | jsonify }},"wordCount":{{ .WordCount }}}
+{{- $first = false -}}
+{{- end -}}
+{{- end -}}
+]
diff --git a/layouts/_default/single.html b/layouts/_default/single.html
index 271ddd8..d20343b 100644
--- a/layouts/_default/single.html
+++ b/layouts/_default/single.html
@@ -7,7 +7,7 @@
<div class="meta">
{{/* Publish date */}}
<time datetime="{{ .PublishDate }}" title='{{ .PublishDate.Format "Mon, Jan 2, 2006, 3:04 PM MST" }}'>
- {{ .PublishDate.Format "02/01/2006" }} - Estimated reading time: {{ .ReadingTime }} minutes
+ {{ .PublishDate.Format "02/01/2006" }} - {{ .WordCount }} words - Estimated reading time: {{ .ReadingTime }} minutes
</time>
{{/* Categories */}}