aboutsummaryrefslogtreecommitdiff
path: root/themes/default/layouts/partials/meta-word-count.html
diff options
context:
space:
mode:
Diffstat (limited to 'themes/default/layouts/partials/meta-word-count.html')
-rw-r--r--themes/default/layouts/partials/meta-word-count.html34
1 files changed, 21 insertions, 13 deletions
diff --git a/themes/default/layouts/partials/meta-word-count.html b/themes/default/layouts/partials/meta-word-count.html
index d4a4065..1c44c78 100644
--- a/themes/default/layouts/partials/meta-word-count.html
+++ b/themes/default/layouts/partials/meta-word-count.html
@@ -1,14 +1,22 @@
-{{ $author := index .Site.Data ((or .Params.author .Site.Author.default.user) | default "default") }}
-{{ $limit := $author.wordlimit }}
-{{ $wordLimit := gt .WordCount $limit }}
-{{ $overLimit := sub .WordCount $limit }}
+<micro-metadata-wordcount>
+ {{- $author := index .Site.Data ((or .Params.author .Site.Author.default.user) | default "default") -}}
+ {{- $limit := $author.wordlimit -}}
+ {{- $wordLimit := gt .WordCount $limit -}}
+ {{- $overLimit := sub .WordCount $limit -}}
+ {{- safeHTML (readFile (print (partial "function-paths-static.html") "/icons/feather/file-text.svg")) -}}
-<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>
+ <word-limit title="{{- if $wordLimit -}} {{ $overLimit }} words over the limit {{- else -}} {{ .WordCount }} words {{- end -}}">
+ <word-count>
+ {{- if $wordLimit -}}
+ <em>{{ .WordCount }}</em>
+ {{- else -}}
+ {{ .WordCount }}
+ {{- end -}}
+ /{{ $limit }} 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. */ -}}
+</micro-metadata-wordcount>
+{{- /* This comment removes trailing newlines and white spaces. */ -}}