diff options
Diffstat (limited to 'themes/default/layouts/_default/section.likes.html')
-rw-r--r-- | themes/default/layouts/_default/section.likes.html | 44 |
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 -}} |