hugo-theme-anubis2/layouts/partials/pagination.html
2020-02-18 20:55:17 +03:00

20 lines
950 B
HTML

{{ if or ( .Paginator.HasPrev ) ( .Paginator.HasNext ) }}
{{ $toNewPostsMessage := i18n "toNewPosts" | humanize }}
{{ $toOldPostsMessage := i18n "toOldPosts" | humanize }}
<div class="pagination">
<div class="left pagination-item {{ if not .Paginator.HasPrev }}disabled{{ end }}">
{{ if .Paginator.HasPrev }}
{{ if eq .Paginator.PageNumber 2 }}
<a href="{{ .Site.BaseURL }}{{ .Site.LanguagePrefix }}">{{ $toNewPostsMessage }}</a>
{{ else }}
<a href="{{ .Paginator.Prev.URL | absURL }}">{{ $toNewPostsMessage }}</a>
{{ end }}
{{ end }}
</div>
<div class="right pagination-item {{ if not .Paginator.HasNext }}disabled{{ end }}">
{{ if .Paginator.HasNext }}
<a href="{{ .Paginator.Next.URL | absURL }}">{{ $toOldPostsMessage }}</a>
{{ end }}
</div>
</div>
{{ end }}