mirror of
https://github.com/adityatelange/hugo-PaperMod.git
synced 2024-12-25 14:35:52 -05:00
Move post nav links to a partial section (#343)
This commit is contained in:
parent
0f4dc88c63
commit
427053290d
@ -37,25 +37,7 @@
|
||||
</ul>
|
||||
{{- end }}
|
||||
{{- if (.Param "ShowPostNavLinks") }}
|
||||
{{- $pages := where site.RegularPages "Type" "in" site.Params.mainSections }}
|
||||
{{- if and (gt (len $pages) 1) (in $pages . ) }}
|
||||
<nav class="paginav">
|
||||
{{- with $pages.Next . }}
|
||||
<a class="prev" href="{{ .Permalink }}">
|
||||
<span class="title">« {{ i18n "prev_page" }}</span>
|
||||
<br>
|
||||
<span>{{- .Name -}}</span>
|
||||
</a>
|
||||
{{- end }}
|
||||
{{- with $pages.Prev . }}
|
||||
<a class="next" href="{{ .Permalink }}">
|
||||
<span class="title">{{ i18n "next_page" }} »</span>
|
||||
<br>
|
||||
<span>{{- .Name -}}</span>
|
||||
</a>
|
||||
{{- end }}
|
||||
</nav>
|
||||
{{- end }}
|
||||
{{- partial "post_nav_links.html" . }}
|
||||
{{- end }}
|
||||
{{- if (and .Site.Params.ShowShareButtons (ne .Params.disableShare true)) }}
|
||||
{{- partial "share_icons.html" . -}}
|
||||
|
19
layouts/partials/post_nav_links.html
Normal file
19
layouts/partials/post_nav_links.html
Normal file
@ -0,0 +1,19 @@
|
||||
{{- $pages := where site.RegularPages "Type" "in" site.Params.mainSections }}
|
||||
{{- if and (gt (len $pages) 1) (in $pages . ) }}
|
||||
<nav class="paginav">
|
||||
{{- with $pages.Next . }}
|
||||
<a class="prev" href="{{ .Permalink }}">
|
||||
<span class="title">« {{ i18n "prev_page" }}</span>
|
||||
<br>
|
||||
<span>{{- .Name -}}</span>
|
||||
</a>
|
||||
{{- end }}
|
||||
{{- with $pages.Prev . }}
|
||||
<a class="next" href="{{ .Permalink }}">
|
||||
<span class="title">{{ i18n "next_page" }} »</span>
|
||||
<br>
|
||||
<span>{{- .Name -}}</span>
|
||||
</a>
|
||||
{{- end }}
|
||||
</nav>
|
||||
{{- end }}
|
Loading…
Reference in New Issue
Block a user