1
0
web/layouts/partials/pagination.html

19 lines
763 B
HTML
Raw Normal View History

2024-04-05 08:09:39 +00:00
{{ $pages := .Pages }} {{ if .IsHome }} {{ $pages = .Site.RegularPages }} {{ end }} {{ $paginator := .Paginate $pages }} {{ range $paginator.Pages }} {{ .Render "summary"}} {{ end }}
{{ if or (.Paginator.HasPrev) (.Paginator.HasNext) }}
{{ $prev := "fa fa-chevron-left"}}
{{ $next := "fa fa-chevron-right"}}
<nav class="pagination" role="pagination">
{{ if .Paginator.HasPrev }}
<a href="{{ .Paginator.Prev.URL }}"><i class="{{ $prev }}"></i></a>
{{ else }}
<i class="{{ $prev }}"></i>
{{ end }}
<span>&nbsp;{{ .Paginator.PageNumber }} / {{ .Paginator.TotalPages }}&nbsp;</span>
{{ if .Paginator.HasNext }}
<a href="{{ .Paginator.Next.URL }}"><i class="{{ $next }}"></i></a>
{{ else }}
<i class="{{ $next }}"></i>
{{ end }}
</nav>
{{ end }}