diff --git a/archetypes/chapter.md b/archetypes/chapter.md index 3fe15e2cec..1d975216f1 100644 --- a/archetypes/chapter.md +++ b/archetypes/chapter.md @@ -1,9 +1,6 @@ --- title: "Some Chapter title" weight: 0 -prev: /prev/path -next: /next/path -chapter: true icon: "X. " # HTML code as prefix in the menu --- diff --git a/archetypes/default.md b/archetypes/default.md index 2b35103feb..e47481e95a 100644 --- a/archetypes/default.md +++ b/archetypes/default.md @@ -1,8 +1,6 @@ --- title: "Some Title" weight: 5 -prev: /prev/path -next: /next/path toc: true --- diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index 86cf6c7695..ffc2b6922f 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -5,39 +5,29 @@ - {{ with .Site.Params.menu }} - {{ range $index, $element := . }} - {{ with index $.Site.Params.menu (sub $index 1)}} - {{ $prev := index (last 1 (index $.Site.Sections .)) 0 }} - {{ $.Scratch.SetInMap $element "prev" $prev }} - {{ end }} - {{ with index $.Site.Params.menu (add $index 1)}} - {{ $next := index (first 1 (index $.Site.Sections .)) 0 }} - {{ $.Scratch.SetInMap $element "next" $next }} - {{ end }} - {{ end }} - {{ else }} - {{ range $key, $section := $.Site.Sections }} - {{ with $prevSec := $.Scratch.Get "prevIter"}} - {{ with index $.Site.Sections . }} - {{ $.Scratch.SetInMap $key "prev" (index (last 1 .) 0) }} - {{ $.Scratch.SetInMap $prevSec "next" (index (first 1 $section) 0) }} - {{ end }} - {{ end }} - {{ $.Scratch.Set "prevIter" $key }} + {{ $.Scratch.Set "_sectionpages" (slice) }} + {{ range $sname, $spages := .Site.Sections }} + {{ $.Scratch.Add "_sectionpages" ($.Site.GetPage "section" $sname) }} + {{ end }} + {{ $.Scratch.Set "_allpages" (slice) }} + {{ range sort ($.Scratch.Get "_sectionpages") "Weight" }} + {{ $.Scratch.Add "_allpages" . }} + {{ range index $.Site.Sections .Section }} + {{ $.Scratch.Add "_allpages" .Page }} {{ end }} {{ end }} + {{ $allpages := $.Scratch.Get "_allpages" }} +