aboutsummaryrefslogtreecommitdiff
path: root/themes/default/layouts/partials/meta-word-count.html
blob: d4a4065a4e86a88db430fe2d80f099599d85cc48 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
{{ $author    := index .Site.Data ((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>