diff options
Diffstat (limited to 'themes/default/layouts/partials/pagination.html')
-rw-r--r-- | themes/default/layouts/partials/pagination.html | 83 |
1 files changed, 83 insertions, 0 deletions
diff --git a/themes/default/layouts/partials/pagination.html b/themes/default/layouts/partials/pagination.html new file mode 100644 index 0000000..4c1669e --- /dev/null +++ b/themes/default/layouts/partials/pagination.html @@ -0,0 +1,83 @@ +<paginator-navigation> + {{- with .Paginator -}} + + {{ if and .HasPrev .First }} + <a + href="{{ .First.URL }}" + aria-label="First" + title="First" + role="button"> + First + </a> + {{ else }} + <button + disabled + title="Disabled" + aria-label="First"> + First + </button> + {{- end -}} + + {{ with .Prev }} + <a + href="{{ .URL }}" + aria-label="Back" + title="Back" + role="button"> + {{ safeHTML (readFile "static/icons/feather/arrow-left.svg") }} + Back + </a> + {{ else }} + <button + disabled + title="Disabled" + aria-label="Back"> + {{ safeHTML (readFile "static/icons/feather/arrow-left.svg") }} + Back + </button> + {{- end -}} + + {{ + $hidden := (sub .TotalNumberOfElements + (sub (len $.Site.RegularPages) (len (where $.Site.Pages "Type" "page")))) + }} + + + {{ if .Next }} + <a + href="{{ .Next.URL }}" + aria-label="Next" + title="Next" + role="button"> + Next + {{ safeHTML (readFile "static/icons/feather/arrow-right.svg") }} + </a> + {{ else }} + <button + disabled + title="Disabled" + aria-label="Next"> + Next + {{ safeHTML (readFile "static/icons/feather/arrow-right.svg") }} + </button> + {{- end -}} + + + {{ if and .HasNext .Last }} + <a + href="{{ .Last.URL }}" + aria-label="Last" + title="Next" + role="button"> + Last + </a> + {{ else }} + <button + disabled + title="Disabled" + aria-label="Last"> + Last + </button> + {{- end -}} + {{ end }} +</paginator-navigation> |