aboutsummaryrefslogtreecommitdiff
path: root/themes/default/layouts/partials/meta-wordcount.html
blob: b6ec95efe87f56a04af479ec8abcd80f82162c9c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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. */ -}}