aboutsummaryrefslogtreecommitdiff
path: root/themes/default/layouts/partials/pagination.html
diff options
context:
space:
mode:
Diffstat (limited to 'themes/default/layouts/partials/pagination.html')
-rw-r--r--themes/default/layouts/partials/pagination.html87
1 files changed, 35 insertions, 52 deletions
diff --git a/themes/default/layouts/partials/pagination.html b/themes/default/layouts/partials/pagination.html
index fa3c85e..e64bfcf 100644
--- a/themes/default/layouts/partials/pagination.html
+++ b/themes/default/layouts/partials/pagination.html
@@ -1,67 +1,50 @@
{{- with .Paginator -}}
-
- {{- $first := "Newest" -}}
- {{- $prev := "Newer" -}}
- {{- $next := "Older" -}}
- {{- $last := "Oldest" -}}
- {{- $invisible := "data-invisible" -}}
-
- {{- $firstData := $invisible -}}
- {{- $firstHref := "" -}}
- {{- $firstTitle := $first -}}
+ {{- $firstTitle := "hidden" -}}
+ {{- $prevTitle := "hidden" -}}
+ {{- $nextTitle := "hidden" -}}
+ {{- $lastTitle := "hidden" -}}
+ {{- $firstHref := "/" -}}
+ {{- $prevHref := "/" -}}
+ {{- $nextHref := "/" -}}
+ {{- $lastHref := "/" -}}
{{- if and .HasPrev .First -}}
- {{- $firstData = "" -}}
- {{- $firstHref = .First.URL -}}
+ {{- $firstHref = .First.URL | absURL -}}
+ {{- $firstTitle = "Newest" -}}
{{- end -}}
- {{- $prevData := $invisible -}}
- {{- $prevHref := "" -}}
- {{- $prevRel := "prev" -}}
- {{- $prevTitle := $prev -}}
-
{{- with .Prev -}}
- {{- $prevData = "" -}}
- {{- $prevHref = .URL -}}
+ {{- $prevHref = .URL | absURL -}}
+ {{- $prevTitle = "Newer" -}}
{{- end -}}
- {{- $nextData := $invisible -}}
- {{- $nextHref := "" -}}
- {{- $nextRel := "next" -}}
- {{- $nextTitle := $next -}}
-
{{- if .Next -}}
- {{- $nextData = "" -}}
- {{- $nextHref = .Next.URL -}}
+ {{- $nextHref = .Next.URL | absURL -}}
+ {{- $nextTitle = "Older" -}}
{{- end -}}
- {{- $lastData := $invisible -}}
- {{- $lastHref := "" -}}
- {{- $lastTitle := $last -}}
-
{{- if and .HasNext .Last -}}
- {{- $lastData = "" -}}
- {{- $lastHref = .Last.URL -}}
+ {{- $lastHref = .Last.URL | absURL -}}
+ {{- $lastTitle = "Oldest" -}}
{{- end -}}
- <paginator-navigation{{ if eq .TotalPages 1 }} hidden {{ end }}>
-
- <a {{ $firstData | safeHTMLAttr }} href="{{ $firstHref }}" title="{{ $firstTitle }}" >
- {{ $firstTitle }}
- </a>
-
- <a rel="{{ $prevRel }}" {{ $prevData | safeHTMLAttr }} href="{{ $prevHref }}" title="{{ $prevTitle }}">
- {{ safeHTML (readFile (print (partial "function-paths.html").static "/icons/feather/arrow-left.svg")) }}
- {{ $prevTitle }}
- </a>
-
- <a rel="{{ $nextRel }}" {{ $nextData | safeHTMLAttr }} href="{{ $nextHref }}" title="{{ $nextTitle }}">
- {{ $nextTitle }}
- {{ safeHTML (readFile (print (partial "function-paths.html").static "/icons/feather/arrow-right.svg")) }}
- </a>
-
- <a {{ $lastData | safeHTMLAttr }} href="{{ $lastHref }}" title="{{ $lastTitle }}" >
- {{ $lastTitle }}
- </a>
- </paginator-navigation>
+ <nav{{ if le .TotalPages 1 }} hidden="" {{ end }} data-type="pagination">
+ <a rel="first" href="{{ $firstHref }}" title="{{ $firstTitle }}" >
+ <span>{{ $firstTitle }}</span>
+ </a>
+
+ <a rel="prev" href="{{ $prevHref }}" title="{{ $prevTitle }}">
+ {{ safeHTML (readFile (print (partial "function-paths.html").static "/icons/feather/arrow-left.svg")) }}
+ <span>{{ $prevTitle }}</span>
+ </a>
+
+ <a rel="next" href="{{ $nextHref }}" title="{{ $nextTitle }}">
+ <span>{{ $nextTitle }}</span>
+ {{ safeHTML (readFile (print (partial "function-paths.html").static "/icons/feather/arrow-right.svg")) }}
+ </a>
+
+ <a rel="last" href="{{ $lastHref }}" title="{{ $lastTitle }}" data-count="{{ .TotalPages }}">
+ <span>{{ $lastTitle }}</span>
+ </a>
+ </nav>
{{- end -}}