aboutsummaryrefslogtreecommitdiff
path: root/themes/default/layouts/partials/meta-expiry-date.html
diff options
context:
space:
mode:
authortdro <tdro@noreply.example.com>2022-10-26 21:53:13 -0400
committertdro <tdro@noreply.example.com>2022-10-26 21:53:13 -0400
commitc00dc361b7d3924df8abca4a32427d0a1232dc0b (patch)
treedf53050fcf827de213516df2c5fe6d172982b9f1 /themes/default/layouts/partials/meta-expiry-date.html
parentc35943c3ed36fb178c09c0185c5d363b9bf4116f (diff)
downloadcanory-c00dc361b7d3924df8abca4a32427d0a1232dc0b.tar.gz
canory-c00dc361b7d3924df8abca4a32427d0a1232dc0b.tar.bz2
canory-c00dc361b7d3924df8abca4a32427d0a1232dc0b.zip
config: Overwrite and build expired0.11.5
Remove xkcd from content security policy, no longer needed.
Diffstat (limited to 'themes/default/layouts/partials/meta-expiry-date.html')
-rw-r--r--themes/default/layouts/partials/meta-expiry-date.html8
1 files changed, 7 insertions, 1 deletions
diff --git a/themes/default/layouts/partials/meta-expiry-date.html b/themes/default/layouts/partials/meta-expiry-date.html
index e2c4838..62f01da 100644
--- a/themes/default/layouts/partials/meta-expiry-date.html
+++ b/themes/default/layouts/partials/meta-expiry-date.html
@@ -1,9 +1,15 @@
{{- if .ExpiryDate -}}
+ {{- $expired := and .ExpiryDate (ge now.Unix .ExpiryDate.Unix) -}}
{{- $diff := now.Sub .ExpiryDate -}}
{{- $duration := lang.FormatNumberCustom 0 (math.Round (mul (div $diff.Hours 24) -1)) -}}
+ {{- $date := .ExpiryDate | time.Format "Monday, January 2 2006 at 15:04:05 MST" -}}
+ {{- $title := print "Self destructs within" " " $duration " " "days" " " "(" $date ")" -}}
+ {{- if $expired -}}
+ {{- $title = print "Self destructed" " " $date -}}
+ {{- end -}}
<micro-metadata-expiry
- title="Self destructs within {{ $duration }} days ({{ .ExpiryDate | time.Format "Monday, January 2 2006 at 15:04:05 MST" }})">
+ title="{{ $title }}">
{{- safeHTML (readFile (print (partial "function-paths.html" "static") "/icons/feather/trash-2.svg")) -}}
<time datetime= "{{- .ExpiryDate | time.Format "2006-01-02T15:04:05Z" -}}">
{{- .ExpiryDate | time.Format "Jan 2 2006" -}}