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

20 lines
932 B
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">
2020-02-02 16:01:10 +01:00
<div class="left pagination-item {{ if not .Paginator.HasPrev }}disabled{{ end }}">
2020-01-12 07:51:51 +01:00
{{ if .Paginator.HasPrev }}
{{ if eq .Paginator.PageNumber 2 }}
2020-02-02 16:01:10 +01:00
<a href="{{ .Site.BaseURL }}{{ .Site.LanguagePrefix }}">{{ $toNewPostsMessage }}</a>
2020-01-12 07:51:51 +01:00
{{ else }}
2020-02-02 16:01:10 +01:00
<a href="{{ .Paginator.Prev.URL }}">{{ $toNewPostsMessage }}</a>
2020-01-12 07:51:51 +01:00
{{ end }}
{{ end }}
2020-02-02 16:01:10 +01:00
</div>
<div class="right pagination-item {{ if not .Paginator.HasNext }}disabled{{ end }}">
2020-01-12 07:51:51 +01:00
{{ if .Paginator.HasNext }}
2020-02-02 16:01:10 +01:00
<a href="{{ .Paginator.Next.URL }}">{{ $toOldPostsMessage }}</a>
2020-01-12 07:51:51 +01:00
{{ end }}
</div>
</div>
{{ end }}