blog-theme
This commit is contained in:
parent
29b925d36b
commit
e00e6162ac
22 changed files with 349 additions and 1875 deletions
|
@ -3,28 +3,72 @@
|
|||
{{ if gt $pag.TotalPages 1 }}
|
||||
{{ $scratch.Set "dot_rendered" false }}
|
||||
<nav aria-label="page navigation">
|
||||
{{ if and (ne $pag.PageNumber 1) (ne $pag.PageNumber 2) }}
|
||||
<a href="{{ $pag.First.URL }}" rel="first">« First</a>
|
||||
{{ if and (ne $pag.PageNumber 1) }}
|
||||
<a href="{{ $pag.First.URL }}" rel="first"
|
||||
{{- else -}}
|
||||
<span class="disabled"
|
||||
{{- end }} title="First page">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-6 h-6">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M18.75 19.5l-7.5-7.5 7.5-7.5m-6 15L5.25 12l7.5-7.5" />
|
||||
</svg>
|
||||
{{ if and (ne $pag.PageNumber 1) }}
|
||||
</a>
|
||||
{{ else }}
|
||||
</span>
|
||||
{{ end }}
|
||||
{{ if $pag.HasPrev }}
|
||||
<a href="{{ $pag.Prev.URL }}" rel="prev" class="page-link">‹ Prev</a>
|
||||
{{ if $pag.HasPrev }}
|
||||
<a href="{{ $pag.Prev.URL }}" rel="prev"
|
||||
{{- else -}}
|
||||
<span class="disabled"
|
||||
{{- end }} title="Previous page">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-6 h-6">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M15.75 19.5L8.25 12l7.5-7.5" />
|
||||
</svg>
|
||||
{{ if $pag.HasPrev }}
|
||||
</a>
|
||||
{{ else }}
|
||||
</span>
|
||||
{{ end }}
|
||||
{{ range $pag.Pagers }}
|
||||
{{ if eq . $pag }}
|
||||
{{ .PageNumber }}
|
||||
<span>{{ .PageNumber }}</span>
|
||||
{{ else if and (ge .PageNumber (sub $pag.PageNumber 2)) (le .PageNumber (add $pag.PageNumber 2)) }}
|
||||
{{ $scratch.Set "dot_rendered" false }}
|
||||
<a href="{{ .URL }}">{{ .PageNumber }}</a>
|
||||
{{ else if eq ($scratch.Get "dot_rendered") false }}
|
||||
{{ $scratch.Set "dot_rendered" true }}
|
||||
…
|
||||
<span>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-6 h-6">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M6.75 12a.75.75 0 11-1.5 0 .75.75 0 011.5 0zM12.75 12a.75.75 0 11-1.5 0 .75.75 0 011.5 0zM18.75 12a.75.75 0 11-1.5 0 .75.75 0 011.5 0z" />
|
||||
</svg>
|
||||
</span>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ if $pag.HasNext }}
|
||||
<a href="{{ $pag.Next.URL }}" rel="next" class="page-link">Next ›</a>
|
||||
<a href="{{ $pag.Next.URL }}" rel="next"
|
||||
{{- else -}}
|
||||
<span class="disabled"
|
||||
{{- end }} title="Next page">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-6 h-6">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M8.25 4.5l7.5 7.5-7.5 7.5" />
|
||||
</svg>
|
||||
{{ if $pag.HasNext }}
|
||||
</a>
|
||||
{{ else }}
|
||||
</span>
|
||||
{{ end }}
|
||||
{{ if and (ne $pag.PageNumber $pag.TotalPages) ((ne $pag.PageNumber (sub $pag.TotalPages 1))) }}
|
||||
<a href="{{ $pag.Last.URL }}" rel="last" class="page-link">Last »</a>
|
||||
{{ if and (ne $pag.PageNumber $pag.TotalPages) }}
|
||||
<a href="{{ $pag.Last.URL }}" rel="last"
|
||||
{{- else -}}
|
||||
<span class="disabled"
|
||||
{{ end }} title="Last page">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-6 h-6">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M11.25 4.5l7.5 7.5-7.5 7.5m-6-15l7.5 7.5-7.5 7.5" />
|
||||
</svg>
|
||||
{{ if and (ne $pag.PageNumber $pag.TotalPages) }}
|
||||
</a>
|
||||
{{ else }}
|
||||
</span>
|
||||
{{ end }}
|
||||
</nav>
|
||||
{{ end }}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue