More compatibility issues

This commit is contained in:
Nikolay Yakimov 2017-03-14 02:55:59 +03:00
parent 38301a171f
commit 329d426d86
No known key found for this signature in database
GPG key ID: 8E9303568F9B9650
2 changed files with 8 additions and 2 deletions

View file

@ -4,6 +4,7 @@
{{ else }}
{{ with (index (index .Site.Sections .Section) 0) }}
{{ .Page.Content }}
{{ $.Scratch.Set "uniqueId" .Page.UniqueID }}
{{ end }}
{{ end }}
{{ partial "footer.html" . }}

View file

@ -6,6 +6,7 @@
</div>
</div>
{{ if $.Site.Params.autoNav }}
{{ $.Scratch.Set "_sectionpages" (slice) }}
{{ if $.Site.Params.menu }}
{{ range $sname := $.Site.Params.menu }}
@ -26,11 +27,14 @@
{{ $.Scratch.Add "_allpages" .Page }}
{{ end }}
{{ end }}
{{ $allpages := $.Scratch.Get "_allpages" }}
{{ end }}
<div id="navigation">
{{ if $.Site.Params.autoNav }}
{{ $allpages := $.Scratch.Get "_allpages" }}
{{ range $index, $element := $allpages }}
{{if eq $element.UniqueID $.UniqueID }}
{{ $uniqueid := ($.Scratch.Get "uniqueId" | default $.UniqueID ) }}
{{if eq $element.UniqueID $uniqueid }}
{{ if not (isset $.Params "prev") }}
{{ with index $allpages (sub $index 1) }}
<a class="nav nav-prev" href="{{ $.Site.BaseURL }}{{ .URL }}"> <i class="fa fa-chevron-left"></i></a>
@ -43,6 +47,7 @@
{{ end }}
{{ end }}
{{ end }}
{{ end }}
{{ with .Params.prev }}<a class="nav nav-prev" href="{{ $.Site.BaseURL }}{{ . }}"> <i class="fa fa-chevron-left"></i></a>{{ end }}
{{ with .Params.next }}<a class="nav nav-next" href="{{ $.Site.BaseURL }}{{ . }}" style="margin-right: 0px;"><i class="fa fa-chevron-right"></i></a>{{ end }}
</div>