aboutsummaryrefslogtreecommitdiff
path: root/themes/default/layouts/partials/meta-word-count.html
diff options
context:
space:
mode:
authortdro <tdro@noreply.example.com>2022-05-25 23:45:46 -0400
committertdro <tdro@noreply.example.com>2022-05-25 23:45:46 -0400
commit96b2d6ba409f8195f1d89f7dce4986a7d9837976 (patch)
treee9d3c2c32fcb163f3f3dba5af1d82c8977ac75bc /themes/default/layouts/partials/meta-word-count.html
parentf2fb20b91c465d5cdacbbbbc1dc87055e20cc281 (diff)
downloadcanory-96b2d6ba409f8195f1d89f7dce4986a7d9837976.tar.gz
canory-96b2d6ba409f8195f1d89f7dce4986a7d9837976.tar.bz2
canory-96b2d6ba409f8195f1d89f7dce4986a7d9837976.zip
themes/default/layouts/_default/summary: Collect feed metadata
Namespace summary metadata partials. Add metadata to generated markdown.
Diffstat (limited to 'themes/default/layouts/partials/meta-word-count.html')
-rw-r--r--themes/default/layouts/partials/meta-word-count.html14
1 files changed, 14 insertions, 0 deletions
diff --git a/themes/default/layouts/partials/meta-word-count.html b/themes/default/layouts/partials/meta-word-count.html
new file mode 100644
index 0000000..f566b07
--- /dev/null
+++ b/themes/default/layouts/partials/meta-word-count.html
@@ -0,0 +1,14 @@
+{{ $author := index .Site.Data.authors ((or .Params.author .Site.Author.default.user) | default "default") }}
+{{ $limit := $author.wordlimit }}
+{{ $wordLimit := gt .WordCount $limit }}
+{{ $overLimit := sub .WordCount $limit }}
+
+<word-limit title="{{- if $wordLimit -}}{{ $overLimit }} words over the limit{{ else }} {{ .WordCount }} words {{ end }}">
+ <word-count>
+ {{- if $wordLimit -}}
+ <em>{{ .WordCount }}</em>
+ {{- else -}}
+ {{ .WordCount }}
+ {{- end -}}
+ </word-count>/{{ $limit }} words
+</word-limit>