hugo-theme-anubis2/layouts/partials/pagination.html

24 lines
1.1 KiB
HTML
Raw Normal View History

2020-01-12 07:51:51 +01:00
{{ if or ( .Paginator.HasPrev ) ( .Paginator.HasNext ) }}
2020-01-26 17:09:07 +01:00
{{ $toNewPostsMessage := i18n "toNewPosts" | humanize }}
{{ $toOldPostsMessage := i18n "toOldPosts" | humanize }}
2020-01-12 07:51:51 +01:00
<div class="pagination">
<div class="left">
{{ if .Paginator.HasPrev }}
{{ if eq .Paginator.PageNumber 2 }}
2020-01-26 17:09:07 +01:00
<a class="pagination-item" href="{{ .Site.BaseURL }}{{ .Site.LanguagePrefix }}">{{ $toNewPostsMessage }}</a>
2020-01-12 07:51:51 +01:00
{{ else }}
2020-01-26 17:09:07 +01:00
<a class="pagination-item" href="{{ .Paginator.Prev.URL }}">{{ $toNewPostsMessage }}</a>
2020-01-12 07:51:51 +01:00
{{ end }}
{{ else }}
2020-01-26 17:09:07 +01:00
<span class="pagination-item disabled">{{ $toNewPostsMessage }}</span>
2020-01-12 07:51:51 +01:00
{{ end }}
</div>
<div class="right">
{{ if .Paginator.HasNext }}
2020-01-26 17:09:07 +01:00
<a class="pagination-item" href="{{ .Paginator.Next.URL }}">{{ $toOldPostsMessage }}</a>
2020-01-12 07:51:51 +01:00
{{ else }}
2020-01-26 17:09:07 +01:00
<span class="pagination-item disabled">{{ $toOldPostsMessage }}</span>
2020-01-12 07:51:51 +01:00
{{ end }}
</div>
</div>
{{ end }}