From efbe64374708fe253fe988d47a4bd3142d98fe42 Mon Sep 17 00:00:00 2001 From: Vidhu Kant Sharma Date: Thu, 5 Jan 2023 20:15:27 +0530 Subject: Properly showing list of blog posts per year --- layouts/blog/list.html | 35 +++++++++++++++++++++++------------ 1 file changed, 23 insertions(+), 12 deletions(-) (limited to 'layouts') diff --git a/layouts/blog/list.html b/layouts/blog/list.html index 1aa589a..044f587 100644 --- a/layouts/blog/list.html +++ b/layouts/blog/list.html @@ -2,19 +2,30 @@

{{ if .Params.heading }}{{ .Params.heading }}{{ else }}{{ .Title }}{{ end }}

{{ .Content }} + + {{ if .Sections }} {{ range .Sections.ByDate.Reverse }} -

{{ .Title }}:

- + +

{{ .Title }}:

+
+ {{ range (union .Sections .Pages).ByDate.Reverse }} +

+ {{ .Title }} + + {{ .Date.Format "2" }}{{ if in (slice 1 21 31) .Date.Day}}st{{ else if in (slice 2 22) .Date.Day}}nd{{ else if in (slice 3 23) .Date.Day}}rd{{ else }}th{{ end }} {{ .Date.Format "January" }} + +

+ {{ end }} + {{ end }} + {{ else }} + {{ range (union .Sections .Pages).ByDate.Reverse }} +

+ {{ .Title }} + + {{ .Date.Format "2" }}{{ if in (slice 1 21 31) .Date.Day}}st{{ else if in (slice 2 22) .Date.Day}}nd{{ else if in (slice 3 23) .Date.Day}}rd{{ else }}th{{ end }} {{ .Date.Format "January" }} + +

{{ end }} + {{ end }}
{{ end }} - -- cgit v1.2.3