Move post nav links to a partial section (#343)
This commit is contained in:
parent
0f4dc88c63
commit
427053290d
@ -37,25 +37,7 @@
|
|||||||
</ul>
|
</ul>
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- if (.Param "ShowPostNavLinks") }}
|
{{- if (.Param "ShowPostNavLinks") }}
|
||||||
{{- $pages := where site.RegularPages "Type" "in" site.Params.mainSections }}
|
{{- partial "post_nav_links.html" . }}
|
||||||
{{- 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 }}
|
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- if (and .Site.Params.ShowShareButtons (ne .Params.disableShare true)) }}
|
{{- if (and .Site.Params.ShowShareButtons (ne .Params.disableShare true)) }}
|
||||||
{{- partial "share_icons.html" . -}}
|
{{- 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