diff options
author | tdro <tdro@noreply.example.com> | 2022-07-09 10:13:53 -0400 |
---|---|---|
committer | tdro <tdro@noreply.example.com> | 2022-07-09 10:13:53 -0400 |
commit | 8e1256308c9c24fa45783a7c0be7ff74a33906ee (patch) | |
tree | b3c62a2f4eb6bfb0a0ac0c8e7563507a2677df6d /themes/default/layouts/partials/meta-expiry-date.html | |
parent | 2b0c90bcf35d2a68a4ac4aabec6e9c04fd6e234f (diff) | |
download | canory-8e1256308c9c24fa45783a7c0be7ff74a33906ee.tar.gz canory-8e1256308c9c24fa45783a7c0be7ff74a33906ee.tar.bz2 canory-8e1256308c9c24fa45783a7c0be7ff74a33906ee.zip |
themes/default/layouts/partials/card-meta: Add icons
Dry up and normalize white spaces.
Diffstat (limited to 'themes/default/layouts/partials/meta-expiry-date.html')
-rw-r--r-- | themes/default/layouts/partials/meta-expiry-date.html | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/themes/default/layouts/partials/meta-expiry-date.html b/themes/default/layouts/partials/meta-expiry-date.html index 275e04e..b04dd1f 100644 --- a/themes/default/layouts/partials/meta-expiry-date.html +++ b/themes/default/layouts/partials/meta-expiry-date.html @@ -1,11 +1,15 @@ -{{ $diff := now.Sub .ExpiryDate }} -{{ $duration := lang.FormatNumberCustom 0 (math.Round (mul (div $diff.Hours 24) -1)) }} +{{- if .ExpiryDate -}} + {{- $diff := now.Sub .ExpiryDate -}} + {{- $duration := lang.FormatNumberCustom 0 (math.Round (mul (div $diff.Hours 24) -1)) -}} -<expiry-date> - <time - datetime= "{{ .ExpiryDate | time.Format "2006-01-02T15:04:05Z" }}" - title="Self destructs within {{ $duration }} days ({{ .ExpiryDate | time.Format "Monday, January 2 2006 at 15:04:05 MST" }})"> - {{ safeHTML (readFile (print (partial "function-paths-static.html") "/icons/feather/trash-2.svg")) }} - {{ .ExpiryDate | time.Format "Jan 2 2006" }} - </time> -</expiry-date> + <micro-metadata-expiry> + <time + datetime= "{{- .ExpiryDate | time.Format "2006-01-02T15:04:05Z" -}}" + title="Self destructs within {{ $duration }} days ({{ .ExpiryDate | time.Format "Monday, January 2 2006 at 15:04:05 MST" }})"> + {{- safeHTML (readFile (print (partial "function-paths-static.html") "/icons/feather/trash-2.svg")) -}} + {{- .ExpiryDate | time.Format "Jan 2 2006" -}} +{{- /* This comment removes trailing newlines and white spaces. */ -}} + </time> +{{- /* This comment removes trailing newlines and white spaces. */ -}} + </micro-metadata-expiry> +{{- end -}} |