From fff324192e92fa170ad9bd5ad3f940b20fc4fa9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E8=B5=B5=E5=90=8C=E5=AD=A6?= <94612053+imzql@users.noreply.github.com> Date: Thu, 19 Sep 2024 23:57:44 +0800 Subject: [PATCH] Update home.html --- themes/Ying/layouts/_default/home.html | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/themes/Ying/layouts/_default/home.html b/themes/Ying/layouts/_default/home.html index 19b1b4dc..1963a86f 100644 --- a/themes/Ying/layouts/_default/home.html +++ b/themes/Ying/layouts/_default/home.html @@ -5,28 +5,34 @@

随笔

- {{ $posts := sort (where (where .Site.RegularPages "Type" "post") "Params.status" "ne" "hidden") "Weight" }} + {{ $posts := sort (where (where .Site.RegularPages "Type" "post") "Params.status" "ne" "hidden") + "Weight" }} {{ $paginator := .Paginate $posts }} - + {{ range $paginator.Pages }}
{{ .Date.Format "January 2, 2006" }}
{{ .Title }} - + {{ $publishDate := .Date }} {{ $currentTime := now }} {{ $timeDiff := div (sub $currentTime.Unix $publishDate.Unix) 3600 }} - - - {{ if lt $timeDiff 24 }} + + + {{ if and (lt $timeDiff 24) (not .Params.weight) }} {{ end }} + + {{ if .Params.weight }} + + + {{ end }}
{{ end }}
- +