From 8921e27e1678b7378666aa37ff9ade5a2ba84c81 Mon Sep 17 00:00:00 2001 From: Michael Dorner Date: Fri, 2 Sep 2022 11:45:55 +0200 Subject: [PATCH 1/2] Fix issue Fixes issues of Hugo throwing the following error: `_default/term.html:16:14: executing "main" at <.Paginate>: error calling Paginate: cannot convert type page.PagesGroup to Pages` --- layouts/_default/term.html | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/layouts/_default/term.html b/layouts/_default/term.html index 32d7ad81..5dff108c 100644 --- a/layouts/_default/term.html +++ b/layouts/_default/term.html @@ -13,15 +13,17 @@ {{ end }}
- {{ range (.Paginate (.Pages.GroupByDate "2006")).PageGroups }} - {{ if $.Params.groupByYear | default ($.Site.Params.list.groupByYear | default true) }} -

- {{ .Key }} -

-
- {{ end }} - {{ range .Pages }} - {{ partial "article-link.html" . }} + {{ if .Data.Pages }} + {{ range (.Paginate (.Pages.GroupByDate "2006")).PageGroups }} + {{ if $.Params.groupByYear | default ($.Site.Params.list.groupByYear | default true) }} +

+ {{ .Key }} +

+
+ {{ end }} + {{ range .Pages }} + {{ partial "article-link.html" . }} + {{ end }} {{ end }} {{ end }}
From c58bde01262b2443dffadaa25a511b00214c1c45 Mon Sep 17 00:00:00 2001 From: James Panther <4462786+jpanther@users.noreply.github.com> Date: Tue, 8 Nov 2022 12:31:05 +1100 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=A5=85=20Catch=20when=20no=20articles?= =?UTF-8?q?=20exist?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- layouts/_default/term.html | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/layouts/_default/term.html b/layouts/_default/term.html index 5dff108c..7d3c0d8e 100644 --- a/layouts/_default/term.html +++ b/layouts/_default/term.html @@ -14,17 +14,30 @@ {{ end }}
{{ if .Data.Pages }} - {{ range (.Paginate (.Pages.GroupByDate "2006")).PageGroups }} +
{{ if $.Params.groupByYear | default ($.Site.Params.list.groupByYear | default true) }} -

- {{ .Key }} -

-
+ {{ range (.Paginate (.Pages.GroupByDate "2006")).PageGroups }} +

+ {{ .Key }} +

+
+ {{ range .Pages }} + {{ partial "article-link.html" . }} + {{ end }} + {{ end }} + {{ else }} + {{ range .Paginator.Pages }} + {{ partial "article-link.html" . }} + {{ end }} {{ end }} - {{ range .Pages }} - {{ partial "article-link.html" . }} - {{ end }} - {{ end }} +
+ {{ partial "pagination.html" . }} + {{ else }} +
+

+ {{ i18n "list.no_articles" | emojify }} +

+
{{ end }}
{{ partial "pagination.html" . }}