aboutsummaryrefslogtreecommitdiff
path: root/themes/default/layouts/partials/meta-readtime.html
blob: 43b5303428806473db1f20bc0a0c75ddd7f25382 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
{{- $seconds := mul (div .WordCount 180.0) 60.0 -}}
{{- $seconds = printf "%.0f" $seconds -}}
{{- if eq $seconds "0" -}}
  {{- $seconds = "1" -}}
{{- end -}}

<meta-readtime title="{{ $seconds }} second{{- if not (eq $seconds "1") -}}s{{- end }} to read">
  {{- safeHTML (readFile (print (partial "function-paths.html").static "/icons/feather/eye.svg")) }}
  <span>{{ $seconds }}s read</span>
{{- /* This comment removes trailing newlines and white spaces. */ -}}
</meta-readtime>
{{- /* This comment removes trailing newlines and white spaces. */ -}}