Skip to content

Commit

Permalink
Merge pull request Mitrichius#194 from Mitrichius/fix-post-pagination…
Browse files Browse the repository at this point in the history
…-without-title

Fix post pagination without post titles
  • Loading branch information
Mitrichius authored Jul 24, 2023
2 parents d5bd8c2 + e3f0473 commit 7ba8c81
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
6 changes: 6 additions & 0 deletions i18n/en.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,9 @@ readNext:

lastMod:
other: "Last modified:"

toNewPost:
other: "to new post"

toOldPost:
other: "to old post"
6 changes: 6 additions & 0 deletions i18n/ru.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,9 @@ readNext:

lastMod:
other: "Отредактировано:"

toNewPost:
other: "к новой записи"

toOldPost:
other: "к старой записи"
6 changes: 4 additions & 2 deletions layouts/partials/post-pagination.html
Original file line number Diff line number Diff line change
@@ -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>
Expand Down

0 comments on commit 7ba8c81

Please sign in to comment.