Merge pull request #194 from Mitrichius/fix-post-pagination-without-title

Fix post pagination without post titles
This commit is contained in:
Dmitry Kolosov 2023-07-24 11:44:29 +03:00 committed by GitHub
commit 7ba8c815fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 2 deletions

View File

@ -54,3 +54,9 @@ readNext:
lastMod:
other: "Last modified:"
toNewPost:
other: "to new post"
toOldPost:
other: "to old post"

View File

@ -51,3 +51,9 @@ readNext:
lastMod:
other: "Отредактировано:"
toNewPost:
other: "к новой записи"
toOldPost:
other: "к старой записи"

View File

@ -1,13 +1,15 @@
{{ if or ( .PrevInSection ) ( .NextInSection ) }}
{{ $toNewPostMessage := i18n "toNewPost" }}
{{ $toOldPostMessage := i18n "toOldPost" }}
<div class="pagination post-pagination">
<div class="left pagination-item {{ if not .NextInSection }}disabled{{ end }}">
{{ if .NextInSection }}
<a href="{{ .NextInSection.RelPermalink }}">{{ .NextInSection.Title }}</a>
<a href="{{ .NextInSection.RelPermalink }}">{{ .NextInSection.Title | default $toNewPostMessage }}</a>
{{ end }}
</div>
<div class="right pagination-item {{ if not .PrevInSection }}disabled{{ end }}">
{{ if .PrevInSection }}
<a href="{{ .PrevInSection.RelPermalink }}">{{ .PrevInSection.Title }}</a>
<a href="{{ .PrevInSection.RelPermalink }}">{{ .PrevInSection.Title | default $toOldPostMessage }}</a>
{{ end }}
</div>
</div>