mirror of
https://github.com/thomasjsn/hugo-theme-hello-friend.git
synced 2024-11-24 16:55:07 +01:00
Add condition to show pagination only in defined contentType pages
This commit is contained in:
parent
779d78a810
commit
95906d6405
@ -32,31 +32,33 @@
|
|||||||
<div class="post-content">
|
<div class="post-content">
|
||||||
{{ .Content }}
|
{{ .Content }}
|
||||||
</div>
|
</div>
|
||||||
{{ if or .NextInSection .PrevInSection }}
|
{{ if eq .Type $.Site.Params.contentTypeName }}
|
||||||
<div class="pagination">
|
{{ if or .NextInSection .PrevInSection }}
|
||||||
<div class="pagination__title">
|
<div class="pagination">
|
||||||
<span class="pagination__title-h">{{ $.Site.Params.ReadOtherPosts | default "Read other posts" }}</span>
|
<div class="pagination__title">
|
||||||
<hr />
|
<span class="pagination__title-h">{{ $.Site.Params.ReadOtherPosts | default "Read other posts" }}</span>
|
||||||
|
<hr />
|
||||||
|
</div>
|
||||||
|
<div class="pagination__buttons">
|
||||||
|
{{ if .NextInSection }}
|
||||||
|
<span class="button previous">
|
||||||
|
<a href="{{ .NextInSection.Permalink }}">
|
||||||
|
<span class="button__icon">←</span>
|
||||||
|
<span class="button__text">{{ .NextInSection.Title }}</span>
|
||||||
|
</a>
|
||||||
|
</span>
|
||||||
|
{{ end }}
|
||||||
|
{{ if .PrevInSection }}
|
||||||
|
<span class="button next">
|
||||||
|
<a href="{{ .PrevInSection.Permalink }}">
|
||||||
|
<span class="button__text">{{ .PrevInSection.Title }}</span>
|
||||||
|
<span class="button__icon">→</span>
|
||||||
|
</a>
|
||||||
|
</span>
|
||||||
|
{{ end }}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="pagination__buttons">
|
{{ end }}
|
||||||
{{ if .NextInSection }}
|
|
||||||
<span class="button previous">
|
|
||||||
<a href="{{ .NextInSection.Permalink }}">
|
|
||||||
<span class="button__icon">←</span>
|
|
||||||
<span class="button__text">{{ .NextInSection.Title }}</span>
|
|
||||||
</a>
|
|
||||||
</span>
|
|
||||||
{{ end }}
|
|
||||||
{{ if .PrevInSection }}
|
|
||||||
<span class="button next">
|
|
||||||
<a href="{{ .PrevInSection.Permalink }}">
|
|
||||||
<span class="button__text">{{ .PrevInSection.Title }}</span>
|
|
||||||
<span class="button__icon">→</span>
|
|
||||||
</a>
|
|
||||||
</span>
|
|
||||||
{{ end }}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{ partial "comments.html" . }}
|
{{ partial "comments.html" . }}
|
||||||
|
Loading…
Reference in New Issue
Block a user