aboutsummaryrefslogtreecommitdiff
path: root/themes/default/layouts/partials/meta-wordcount.html
diff options
context:
space:
mode:
Diffstat (limited to 'themes/default/layouts/partials/meta-wordcount.html')
-rw-r--r--themes/default/layouts/partials/meta-wordcount.html33
1 files changed, 33 insertions, 0 deletions
diff --git a/themes/default/layouts/partials/meta-wordcount.html b/themes/default/layouts/partials/meta-wordcount.html
new file mode 100644
index 0000000..b6ec95e
--- /dev/null
+++ b/themes/default/layouts/partials/meta-wordcount.html
@@ -0,0 +1,33 @@
+{{- $author := partial "function-authors-data.html" . -}}
+{{- $limit := $author.wordlimit -}}
+{{- $wordLimit := gt .WordCount $limit -}}
+{{- $overLimit := sub .WordCount $limit -}}
+{{- $bitCount := lang.FormatNumberCustom 0 (len .Content) -}}
+
+<meta-wordcount
+title="
+{{- if $wordLimit -}}
+ {{ $overLimit }} words over the limit
+ {{- else -}}
+ {{ .WordCount }} words
+{{- end }}
+{{ $bitCount }} bits
+{{- /* This comment removes trailing newlines and white spaces. */ -}}
+">
+{{- /* This comment removes trailing newlines and white spaces. */ -}}
+ <word-limit>
+ {{- safeHTML (readFile (print (partial "function-paths.html").static "/icons/tabler/notes.svg")) -}}
+ <word-count>
+ {{- if $wordLimit -}}
+ <em>{{ .WordCount }}</em>
+ {{- else -}}
+ <sup>{{ .WordCount }}</sup>
+ {{- end -}}
+ /<sub>{{ $limit }}</sub> words
+{{- /* This comment removes trailing newlines and white spaces. */ -}}
+ </word-count>
+{{- /* This comment removes trailing newlines and white spaces. */ -}}
+ </word-limit>
+{{- /* This comment removes trailing newlines and white spaces. */ -}}
+</meta-wordcount>
+{{- /* This comment removes trailing newlines and white spaces. */ -}}