Fixing pagination bug when baseUrl contains not only hostname, but also some path (for example: http://localhost/some/prefix)

This commit is contained in:
Maksim Iakunin 2021-11-06 23:15:00 +03:00
parent 837417e19f
commit 7be92b228e
No known key found for this signature in database
GPG Key ID: 629DE6EA48DAF1F4

View File

@ -1,15 +1,15 @@
{{ if or ( .Paginator.HasPrev ) ( .Paginator.HasNext ) }} {{ if or ( .Paginator.HasPrev ) ( .Paginator.HasNext ) }}
{{ $toNewPostsMessage := i18n "toNewPosts" }} {{ $toNewPostsMessage := i18n "toNewPosts" }}
{{ $toOldPostsMessage := i18n "toOldPosts" }} {{ $toOldPostsMessage := i18n "toOldPosts" }}
<div class="pagination"> <div class="pagination">
<div class="left pagination-item {{ if not .Paginator.HasPrev }}disabled{{ end }}"> <div class="left pagination-item {{ if not .Paginator.HasPrev }}disabled{{ end }}">
{{ if .Paginator.HasPrev }} {{ if .Paginator.HasPrev }}
<a href="{{ .Paginator.Prev.URL | relLangURL }}">{{ $toNewPostsMessage }}</a> <a href="{{ .Paginator.Prev.URL }}">{{ $toNewPostsMessage }}</a>
{{ end }} {{ end }}
</div> </div>
<div class="right pagination-item {{ if not .Paginator.HasNext }}disabled{{ end }}"> <div class="right pagination-item {{ if not .Paginator.HasNext }}disabled{{ end }}">
{{ if .Paginator.HasNext }} {{ if .Paginator.HasNext }}
<a href="{{ .Paginator.Next.URL | relLangURL }}">{{ $toOldPostsMessage }}</a> <a href="{{ .Paginator.Next.URL }}">{{ $toOldPostsMessage }}</a>
{{ end }} {{ end }}
</div> </div>
</div> </div>