Add pagination for post single page. Close #22

This commit is contained in:
Dmitry Kolosov 2020-06-07 14:20:40 +03:00
parent 9ea38661fb
commit 899d9fd52d
4 changed files with 36 additions and 1 deletions

View file

@ -9,6 +9,11 @@
</div>
{{ partial "postInfo.html" . }}
</article>
{{ if .Site.Params.paginationSinglePost}}
{{ partial "paginationPost.html" . }}
{{ end }}
{{ if .Site.DisqusShortname }}
{{ template "_internal/disqus.html" . }}
{{ end }}

View file

@ -0,0 +1,14 @@
{{ if or ( .PrevInSection ) ( .NextInSection ) }}
<div class="pagination post-pagination">
<div class="left pagination-item {{ if not .PrevInSection }}disabled{{ end }}">
{{ if .PrevInSection }}
<a href="{{ .PrevInSection.Permalink | relLangURL }}">{{ .PrevInSection.Title }}</a>
{{ end }}
</div>
<div class="right pagination-item {{ if not .NextInSection }}disabled{{ end }}">
{{ if .NextInSection }}
<a href="{{ .NextInSection.Permalink | relLangURL }}">{{ .NextInSection.Title }}</a>
{{ end }}
</div>
</div>
{{ end }}