From 93cd009b142782d138fbf746b1145dcb362b0c54 Mon Sep 17 00:00:00 2001 From: tdro Date: Thu, 1 Jun 2023 18:18:29 -0400 Subject: themes/default/layouts/_default/section.likes: Only 1 paginator allowed Format --- themes/default/layouts/_default/section.likes.html | 44 +++++++++++----------- 1 file changed, 21 insertions(+), 23 deletions(-) diff --git a/themes/default/layouts/_default/section.likes.html b/themes/default/layouts/_default/section.likes.html index c91de2e..201c0a5 100644 --- a/themes/default/layouts/_default/section.likes.html +++ b/themes/default/layouts/_default/section.likes.html @@ -1,4 +1,4 @@ -{{ define "styles" }} +{{- define "styles" -}} {{- $author := partial "function-authors-data.html" . -}} {{- $author = $author.user -}} -{{ end }} +{{- end -}} -{{ define "middle" }} +{{- define "middle" -}} + {{- $author := partial "function-authors-data.html" . -}} + {{- $author = $author.user -}} + {{- $users := where .Site.RegularPages "Section" $author -}} + {{- $likes := where .Site.RegularPages ".Params.liked" true -}} + {{- $filteredPages := $users | intersect $likes -}} + {{- $paginator := .Paginate $filteredPages -}} - {{ partial "navigator-middle.html" + {{- partial "navigator-middle.html" (dict "Context" . "IconLabel" "Back" @@ -26,31 +32,23 @@ "Title" "Likes" "Icon" "arrow-left" "Subtitle" (partial "count-likes.html" .) - "Href" (or (and (gt .Paginator.PageNumber 1) (.Paginator.Prev.URL | absURL)) "/") + "Href" (or (and (gt $paginator.PageNumber 1) ($paginator.Prev.URL | absURL)) "/") ) - }} - - {{ partial "profile.html" . }} + -}} - {{- $author := partial "function-authors-data.html" . -}} - {{- $author = $author.user -}} - {{- $users := where .Site.RegularPages "Section" $author -}} - {{- $likes := where .Site.RegularPages ".Params.liked" true -}} - {{- $filteredPages := $users | intersect $likes -}} - {{- $paginator := .Paginate $filteredPages }} + {{- partial "profile.html" . -}} - {{ range $paginator.Pages }} - {{ .Render "summary" }} - {{ else }} + {{- range $paginator.Pages -}} + {{- .Render "summary" -}} + {{- else -}} - {{ end }} - - {{ partial "pagination.html" . }} + {{- end -}} -{{ end }} + {{- partial "pagination.html" . -}} +{{- end -}} -{{ define "right" }} +{{- define "right" -}} {{- partial "navigator-right.html" . -}} -{{ end }} +{{- end -}} -- cgit v1.2.3