From 285e9e879a395b6fa7129ba9915cd92f7961881e Mon Sep 17 00:00:00 2001 From: Adam Ormsby Date: Tue, 17 Dec 2019 11:20:41 +0700 Subject: [PATCH] add time threshold (1 hr) for last mod display --- layouts/partials/lastmod.html | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/layouts/partials/lastmod.html b/layouts/partials/lastmod.html index ff80115..b5ad502 100644 --- a/layouts/partials/lastmod.html +++ b/layouts/partials/lastmod.html @@ -1,4 +1,6 @@ -{{ if gt .Lastmod .Date }} +{{$hourInSec := 3600}}} + +{{ if gt .Lastmod (add (time .Date).Unix $hourInSec) }} {{ with .Lastmod }} ({{ $.Site.Params.LastModDisplay }} {{ .Format ($.Site.Params.DateFormatSingle | default "2006-01-02") }})