fix post pagination without post titles

This commit is contained in:
Dmitry Kolosov 2023-07-24 10:44:01 +02:00
parent d5bd8c2848
commit e3f0473727
3 changed files with 16 additions and 2 deletions

View File

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

View File

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

View File

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