hugo-theme-relearn/layouts/partials/footer.html
Nikolay Yakimov 7aa1e70638
Fixes, see description
* fix menu ordering when mixing chapters and non-chapters
* allow for `chapter` type override in `_index` pages
* fix breadcrumbs
* fix some crashes with empty categories
* use page context in list.html (to avoid setting uniqueid in scratch)
* use UniqueID instead of relative links for page identification
2017-03-27 22:57:49 +03:00

71 lines
3.2 KiB
HTML

{{ $isChapter := .Params.chapter | default (eq .Kind "section")}}
{{ if $isChapter }}
</div> <!-- end chapter-->
{{ end }}
</div>
</div>
{{ if $.Site.Params.autoNav }}
{{ $.Scratch.Set "_sectionpages" (slice) }}
{{ if $.Site.Params.menu }}
{{ range $sname := $.Site.Params.menu }}
{{ $.Scratch.Add "_sectionpages" ($.Site.GetPage "section" $sname) }}
{{ end }}
{{ else }}
{{ range $sname, $spages := .Site.Sections }}
{{ $.Scratch.Add "_sectionpages" ($.Site.GetPage "section" $sname) }}
{{ end }}
{{ $.Scratch.Set "_sectionpages" (sort ($.Scratch.Get "_sectionpages") "Weight") }}
{{ end }}
{{ $.Scratch.Set "_allpages" (slice) }}
{{ range $.Scratch.Get "_sectionpages" }}
{{ if .Content }}
{{ $.Scratch.Add "_allpages" . }}
{{ end }}
{{ range index $.Site.Sections .Section }}
{{ $.Scratch.Add "_allpages" .Page }}
{{ end }}
{{ end }}
{{ end }}
<div id="navigation">
{{ if $.Site.Params.autoNav }}
{{ $allpages := $.Scratch.Get "_allpages" }}
{{ range $index, $element := $allpages }}
{{if eq $element.UniqueID $.UniqueID }}
{{ if not (isset $.Params "prev") }}
{{ with index $allpages (sub $index 1) }}
<a class="nav nav-prev" href="{{ .URL }}"> <i class="fa fa-chevron-left"></i></a>
{{ end }}
{{ end }}
{{ if not (isset $.Params "next") }}
{{ with index $allpages (add $index 1) }}
<a class="nav nav-next" href="{{ .URL }}" style="margin-right: 0px;"><i class="fa fa-chevron-right"></i></a>
{{ end }}
{{ 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>
</section>
<div style="left: -1000px; overflow: scroll; position: absolute; top: -1000px; border: none; box-sizing: content-box; height: 200px; margin: 0px; padding: 0px; width: 200px;">
<div style="border: none; box-sizing: content-box; height: 200px; margin: 0px; padding: 0px; width: 200px;"></div>
</div>
<script src="{{ .Site.BaseURL }}/js/clipboard.min.js"></script>
<script src="{{ .Site.BaseURL }}/js/perfect-scrollbar.min.js"></script>
<script src="{{ .Site.BaseURL }}/js/perfect-scrollbar.jquery.min.js"></script>
<script src="{{ .Site.BaseURL }}/js/jquery.sticky-kit.min.js"></script>
<script src="{{ .Site.BaseURL }}/js/featherlight.min.js"></script>
<script src="{{ .Site.BaseURL }}/js/html5shiv-printshiv.min.js"></script>
<script src="{{ .Site.BaseURL }}/js/highlight.pack.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
<script src="{{ .Site.BaseURL }}/js/modernizr.custom.71422.js"></script>
<script src="{{ .Site.BaseURL }}/js/learn.js"></script>
<script src="{{ .Site.BaseURL }}/js/hugo-learn.js"></script>
{{ partial "script.html" . }}
</body>
</html>