commit 77573bb18246311c3c4e8f766c50a06d3ee2f741
parent e58bf480dac68116e5462a13a3094d4e0676b03b
Author: Pollux <pollux@pollux.codes>
Date: Wed, 22 Jan 2025 23:27:49 -0600
Add reading time and word count to blog posts
Signed-off-by: Pollux <pollux@pollux.codes>
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/layouts/blog/single.html b/layouts/blog/single.html
@@ -1,6 +1,6 @@
{{ define "main" }}
<h1>{{ .Title }}</h1>
-<p>Written on {{ .Date.Format "2006-01-02" }}.</p>
+<p>Written on {{ .Date.Format "2006-01-02" }}. {{ .WordCount }} words, ~{{ .ReadingTime }} {{ if gt .ReadingTime 1 }}mins{{ else }}min{{ end }} </p>
{{ range $k, $term := .GetTerms "blogtags" }}{{ if $k }}, {{ end }}<a href="{{ .RelPermalink }}">{{ lower .Title }}</a>{{ end }}
{{ .Content }}
{{ end }}