diff options
author | tdro <tdro@noreply.example.com> | 2022-07-29 21:24:09 -0400 |
---|---|---|
committer | tdro <tdro@noreply.example.com> | 2022-07-29 21:24:09 -0400 |
commit | b163db67a35a10e153a4fa88d1e1f1d8f9a21f8e (patch) | |
tree | 984d46e6ddd5edbddc4b0735752c2982c8d36f1c /themes/default/layouts/partials/meta-read-time.html | |
parent | cc0f3566fc82fd8bfdeb6d5e4234f052fcd764e9 (diff) | |
download | canory-b163db67a35a10e153a4fa88d1e1f1d8f9a21f8e.tar.gz canory-b163db67a35a10e153a4fa88d1e1f1d8f9a21f8e.tar.bz2 canory-b163db67a35a10e153a4fa88d1e1f1d8f9a21f8e.zip |
static/js: Add relative dates
Diffstat (limited to 'themes/default/layouts/partials/meta-read-time.html')
-rw-r--r-- | themes/default/layouts/partials/meta-read-time.html | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/themes/default/layouts/partials/meta-read-time.html b/themes/default/layouts/partials/meta-read-time.html index 2a5e395..bc32f41 100644 --- a/themes/default/layouts/partials/meta-read-time.html +++ b/themes/default/layouts/partials/meta-read-time.html @@ -1,17 +1,12 @@ -<micro-metadata-readtime> - {{- $seconds := mul (div .WordCount 180.0) 60.0 -}} - {{- $seconds = printf "%.0f" $seconds -}} - - {{- if eq $seconds "0" -}} - {{- $seconds = "1" -}} - {{- end -}} +{{- $seconds := mul (div .WordCount 180.0) 60.0 -}} +{{- $seconds = printf "%.0f" $seconds -}} +{{- if eq $seconds "0" -}} + {{- $seconds = "1" -}} +{{- end -}} +<micro-metadata-readtime> {{- safeHTML (readFile (print (partial "function-paths.html" "static") "/icons/feather/clock.svg")) -}} - - <read-time title="Takes {{ $seconds }} second{{- if not (eq $seconds "1") -}}s{{- end }} to read"> - {{ $seconds }} sec -{{- /* This comment removes trailing newlines and white spaces. */ -}} - </read-time> + <read-time title="Takes {{ $seconds }} second{{- if not (eq $seconds "1") -}}s{{- end }} to read">{{ $seconds }} sec</read-time> {{- /* This comment removes trailing newlines and white spaces. */ -}} </micro-metadata-readtime> {{- /* This comment removes trailing newlines and white spaces. */ -}} |