aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortdro <tdro@noreply.example.com>2023-06-01 18:18:29 -0400
committertdro <tdro@noreply.example.com>2023-06-01 18:19:17 -0400
commit93cd009b142782d138fbf746b1145dcb362b0c54 (patch)
tree17fc3d683c6e32d1c5a8fb1133e3fde88cc39cdd
parent9fd5f2efac6191a64b3c70c04b9cfacc315339a4 (diff)
downloadcanory-93cd009b142782d138fbf746b1145dcb362b0c54.tar.gz
canory-93cd009b142782d138fbf746b1145dcb362b0c54.tar.bz2
canory-93cd009b142782d138fbf746b1145dcb362b0c54.zip
themes/default/layouts/_default/section.likes: Only 1 paginator allowed
Format
-rw-r--r--themes/default/layouts/_default/section.likes.html44
1 files 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 -}}
<style>
@@ -14,11 +14,17 @@
text-decoration: underline;
}
</style>
-{{ 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 -}}
<footer>
<code>No likes found!</code>
</footer>
- {{ end }}
-
- {{ partial "pagination.html" . }}
+ {{- end -}}
-{{ end }}
+ {{- partial "pagination.html" . -}}
+{{- end -}}
-{{ define "right" }}
+{{- define "right" -}}
{{- partial "navigator-right.html" . -}}
-{{ end }}
+{{- end -}}