diff options
| author | Eltrac <hi@guhub.cn> | 2025-11-26 16:46:15 +0800 |
|---|---|---|
| committer | Eltrac <hi@guhub.cn> | 2025-11-26 16:46:15 +0800 |
| commit | fae687fe63dd4d9a6c9fbb645448f78064f42fb9 (patch) | |
| tree | 8e64fe4f870878c151aba814368f567ee28b1730 /layouts/_shortcodes | |
| parent | 0508e570bba631afa8372ab07e8de203612d64de (diff) | |
feat: site uptime count in sponsor page
Former-commit-id: 3fef33e7be229620118b4cc967126f804e59a5cd
Diffstat (limited to 'layouts/_shortcodes')
| -rw-r--r-- | layouts/_shortcodes/daysfrom.html | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/layouts/_shortcodes/daysfrom.html b/layouts/_shortcodes/daysfrom.html new file mode 100644 index 00000000..c2750480 --- /dev/null +++ b/layouts/_shortcodes/daysfrom.html @@ -0,0 +1,12 @@ +{{- $date := .Get 0 -}} +{{- $t := time $date -}} +{{- $now := now -}} +{{- $durSeconds := sub $now.Unix $t.Unix | int -}} + +{{- $days := div $durSeconds 86400 -}} + +{{- if lt $days 0 -}} + {{ mul $days -1 }} +{{- else -}} + {{ $days }} +{{- end -}} |
