Merge pull request #275 from nunocoracao/268-different-pagination-style

 Different pagination style by @martinvisser
This commit is contained in:
Nuno Coração 2022-11-24 21:25:11 +00:00 committed by GitHub
commit b81790c034
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
33 changed files with 272 additions and 34 deletions

View file

@ -35,7 +35,10 @@
url = "http://tee.pub/lic/qwSlWVBL5zc" url = "http://tee.pub/lic/qwSlWVBL5zc"
weight = 50 weight = 50
#[[main]]
# name = "Test"
# pageRef = "pagTest"
# weight = 1000
[[main]] [[main]]
identifier = "twitter" identifier = "twitter"

View file

@ -0,0 +1,19 @@
---
title: "TEST"
date: 2022-06-13T20:55:37+01:00
draft: true
showDate : false
showDateUpdated : false
showHeadingAnchors : false
showPagination : false
showReadingTime : false
showTableOfContents : true
showTaxonomies : false
showWordCount : false
showSummary : false
sharingLinks : false
cardView: false
---

View file

@ -0,0 +1,7 @@
---
title: "Charts"
date: 2019-03-06
summary: "Blowfish includes Chart.js for powerful charts and data visualisations."
tags: ["chart", "sample", "graph", "shortcodes"]
showDate: false
---

View file

@ -0,0 +1,7 @@
---
title: "Charts"
date: 2019-03-06
summary: "Blowfish includes Chart.js for powerful charts and data visualisations."
tags: ["chart", "sample", "graph", "shortcodes"]
showDate: false
---

View file

@ -0,0 +1,7 @@
---
title: "Charts"
date: 2019-03-06
summary: "Blowfish includes Chart.js for powerful charts and data visualisations."
tags: ["chart", "sample", "graph", "shortcodes"]
showDate: false
---

View file

@ -0,0 +1,7 @@
---
title: "Charts"
date: 2019-03-06
summary: "Blowfish includes Chart.js for powerful charts and data visualisations."
tags: ["chart", "sample", "graph", "shortcodes"]
showDate: false
---

View file

@ -0,0 +1,7 @@
---
title: "Charts"
date: 2019-03-06
summary: "Blowfish includes Chart.js for powerful charts and data visualisations."
tags: ["chart", "sample", "graph", "shortcodes"]
showDate: false
---

View file

@ -0,0 +1,7 @@
---
title: "Charts"
date: 2019-03-06
summary: "Blowfish includes Chart.js for powerful charts and data visualisations."
tags: ["chart", "sample", "graph", "shortcodes"]
showDate: false
---

View file

@ -0,0 +1,7 @@
---
title: "Charts"
date: 2019-03-06
summary: "Blowfish includes Chart.js for powerful charts and data visualisations."
tags: ["chart", "sample", "graph", "shortcodes"]
showDate: false
---

View file

@ -0,0 +1,7 @@
---
title: "Charts"
date: 2019-03-06
summary: "Blowfish includes Chart.js for powerful charts and data visualisations."
tags: ["chart", "sample", "graph", "shortcodes"]
showDate: false
---

View file

@ -0,0 +1,7 @@
---
title: "Charts"
date: 2019-03-06
summary: "Blowfish includes Chart.js for powerful charts and data visualisations."
tags: ["chart", "sample", "graph", "shortcodes"]
showDate: false
---

View file

@ -0,0 +1,7 @@
---
title: "Charts"
date: 2019-03-06
summary: "Blowfish includes Chart.js for powerful charts and data visualisations."
tags: ["chart", "sample", "graph", "shortcodes"]
showDate: false
---

View file

@ -0,0 +1,7 @@
---
title: "Charts"
date: 2019-03-06
summary: "Blowfish includes Chart.js for powerful charts and data visualisations."
tags: ["chart", "sample", "graph", "shortcodes"]
showDate: false
---

View file

@ -0,0 +1,7 @@
---
title: "Charts"
date: 2019-03-06
summary: "Blowfish includes Chart.js for powerful charts and data visualisations."
tags: ["chart", "sample", "graph", "shortcodes"]
showDate: false
---

View file

@ -0,0 +1,7 @@
---
title: "Charts"
date: 2019-03-06
summary: "Blowfish includes Chart.js for powerful charts and data visualisations."
tags: ["chart", "sample", "graph", "shortcodes"]
showDate: false
---

View file

@ -0,0 +1,7 @@
---
title: "Charts"
date: 2019-03-06
summary: "Blowfish includes Chart.js for powerful charts and data visualisations."
tags: ["chart", "sample", "graph", "shortcodes"]
showDate: false
---

View file

@ -0,0 +1,7 @@
---
title: "Charts"
date: 2019-03-06
summary: "Blowfish includes Chart.js for powerful charts and data visualisations."
tags: ["chart", "sample", "graph", "shortcodes"]
showDate: false
---

View file

@ -0,0 +1,7 @@
---
title: "Charts"
date: 2019-03-06
summary: "Blowfish includes Chart.js for powerful charts and data visualisations."
tags: ["chart", "sample", "graph", "shortcodes"]
showDate: false
---

View file

@ -0,0 +1,7 @@
---
title: "Charts"
date: 2019-03-06
summary: "Blowfish includes Chart.js for powerful charts and data visualisations."
tags: ["chart", "sample", "graph", "shortcodes"]
showDate: false
---

View file

@ -0,0 +1,7 @@
---
title: "Charts"
date: 2019-03-06
summary: "Blowfish includes Chart.js for powerful charts and data visualisations."
tags: ["chart", "sample", "graph", "shortcodes"]
showDate: false
---

View file

@ -0,0 +1,7 @@
---
title: "Charts"
date: 2019-03-06
summary: "Blowfish includes Chart.js for powerful charts and data visualisations."
tags: ["chart", "sample", "graph", "shortcodes"]
showDate: false
---

View file

@ -0,0 +1,7 @@
---
title: "Charts"
date: 2019-03-06
summary: "Blowfish includes Chart.js for powerful charts and data visualisations."
tags: ["chart", "sample", "graph", "shortcodes"]
showDate: false
---

View file

@ -0,0 +1,7 @@
---
title: "Charts"
date: 2019-03-06
summary: "Blowfish includes Chart.js for powerful charts and data visualisations."
tags: ["chart", "sample", "graph", "shortcodes"]
showDate: false
---

View file

@ -0,0 +1,7 @@
---
title: "Charts"
date: 2019-03-06
summary: "Blowfish includes Chart.js for powerful charts and data visualisations."
tags: ["chart", "sample", "graph", "shortcodes"]
showDate: false
---

View file

@ -0,0 +1,7 @@
---
title: "Charts"
date: 2019-03-06
summary: "Blowfish includes Chart.js for powerful charts and data visualisations."
tags: ["chart", "sample", "graph", "shortcodes"]
showDate: false
---

View file

@ -0,0 +1,7 @@
---
title: "Charts"
date: 2019-03-06
summary: "Blowfish includes Chart.js for powerful charts and data visualisations."
tags: ["chart", "sample", "graph", "shortcodes"]
showDate: false
---

View file

@ -0,0 +1,7 @@
---
title: "Charts"
date: 2019-03-06
summary: "Blowfish includes Chart.js for powerful charts and data visualisations."
tags: ["chart", "sample", "graph", "shortcodes"]
showDate: false
---

View file

@ -0,0 +1,7 @@
---
title: "Charts"
date: 2019-03-06
summary: "Blowfish includes Chart.js for powerful charts and data visualisations."
tags: ["chart", "sample", "graph", "shortcodes"]
showDate: false
---

View file

@ -0,0 +1,7 @@
---
title: "Charts"
date: 2019-03-06
summary: "Blowfish includes Chart.js for powerful charts and data visualisations."
tags: ["chart", "sample", "graph", "shortcodes"]
showDate: false
---

View file

@ -0,0 +1,7 @@
---
title: "Charts"
date: 2019-03-06
summary: "Blowfish includes Chart.js for powerful charts and data visualisations."
tags: ["chart", "sample", "graph", "shortcodes"]
showDate: false
---

View file

@ -0,0 +1,7 @@
---
title: "Charts"
date: 2019-03-06
summary: "Blowfish includes Chart.js for powerful charts and data visualisations."
tags: ["chart", "sample", "graph", "shortcodes"]
showDate: false
---

View file

@ -227,7 +227,6 @@
{{ end }} {{ end }}
{{ end }} {{ end }}
</section> </section>
{{ partial "pagination.html" . }}
{{ end }} {{ end }}
{{ else }} {{ else }}
@ -237,4 +236,8 @@
</p> </p>
</section> </section>
{{ end }} {{ end }}
{{ end }}
{{ partial "pagination.html" . }}
{{ end }}

View file

@ -1,39 +1,49 @@
{{ $paginator := .Paginator }} {{- if gt .Paginator.TotalPages 1 -}}
{{ if gt $paginator.TotalPages 1 }} <ul class="flex flex-row mt-8 justify-center">
<ul class="flex flex-row mt-8"> {{- .Scratch.Set "paginator.ellipsed" false -}}
{{ if $paginator.HasPrev }} {{ if $.Paginator.HasPrev }}
<li> <li>
<a <a
href="{{ $paginator.Prev.URL }}" href="{{ $.Paginator.Prev.URL }}"
class="mx-1 block min-w-[1.8rem] rounded text-center hover:bg-primary-600 hover:text-neutral" class="mx-1 block min-w-[1.8rem] rounded text-center hover:bg-primary-600 hover:text-neutral"
rel="prev" rel="prev"
> >&larr;</a>
&larr; </li>
</a>
</li>
{{ end }} {{ end }}
{{ range $paginator.Pagers }} {{- range $.Paginator.Pagers -}}
<li> {{- $right := sub .TotalPages .PageNumber -}}
<a {{- $showNumber := or (le .PageNumber 1) (eq $right 0) -}}
href="{{ .URL }}" {{- $showNumber := or $showNumber (and (gt .PageNumber (sub $.Paginator.PageNumber 3)) (lt .PageNumber (add $.Paginator.PageNumber 3))) -}}
class="{{ if eq . $paginator }} {{- if $showNumber -}}
bg-primary-200 dark:bg-primary-400 dark:text-neutral-800 {{- $.Scratch.Set "paginator.ellipsed" false -}}
{{ end }} mx-1 block min-w-[1.8rem] rounded text-center hover:bg-primary-600 hover:text-neutral" {{- $.Scratch.Set "paginator.shouldEllipse" false -}}
> {{- else -}}
{{ .PageNumber }} {{- $.Scratch.Set "paginator.shouldEllipse" (not ($.Scratch.Get "paginator.ellipsed") ) -}}
</a> {{- $.Scratch.Set "paginator.ellipsed" true -}}
{{- end -}}
{{- if $showNumber -}}
<li>
<a
href="{{ .URL }}"
class="{{ if eq . $.Paginator }}
bg-primary-200 dark:bg-primary-400 dark:text-neutral-800
{{ end }} mx-1 block min-w-[1.8rem] rounded text-center hover:bg-primary-600 hover:text-neutral"
>{{ .PageNumber }}</a>
</li> </li>
{{ end }} {{- else if ($.Scratch.Get "paginator.shouldEllipse") -}}
{{ if $paginator.HasNext }} <li class="page-item ">
<li> <span class="page-link" aria-hidden="true">&hellip;</span>
<a </li>
href="{{ $paginator.Next.URL }}" {{- end -}}
{{- end -}}
{{ if $.Paginator.HasNext }}
<li>
<a
href="{{ $.Paginator.Next.URL }}"
class="mx-1 block min-w-[1.8rem] rounded text-center hover:bg-primary-600 hover:text-neutral" class="mx-1 block min-w-[1.8rem] rounded text-center hover:bg-primary-600 hover:text-neutral"
rel="next" rel="next"
> >&rarr;</a>
&rarr; </li>
</a>
</li>
{{ end }} {{ end }}
</ul> </ul>
{{ end }} {{- end -}}