1
0
mirror of https://github.com/PrivSec-dev/privsec.dev synced 2025-01-09 13:41:33 -05:00

also sort navigation links (#13)

This commit is contained in:
Wonderfall 2022-07-21 02:43:54 +02:00 committed by GitHub
parent 4f2477405e
commit eabba71aaf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -0,0 +1,19 @@
{{- $pages := where site.RegularPages.ByTitle "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 }}