diff --git a/themes/Ying/layouts/_default/home.html b/themes/Ying/layouts/_default/home.html index 1854a996..6e2bcc4c 100644 --- a/themes/Ying/layouts/_default/home.html +++ b/themes/Ying/layouts/_default/home.html @@ -4,24 +4,29 @@

随笔

- {{ $paginator := .Paginate (where (where .Site.RegularPages "Type" "post") "Params.status" "ne" "hidden") }} + + {{ $posts := where (where .Site.RegularPages "Type" "post") "Params.status" "ne" "hidden" | sort "Weight" "asc" }} + {{ $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 }} - + New {{ end }}
{{ end }}
- +