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/_default/list.html b/layouts/_default/list.html index e69de29bb2..8d1fdab11d 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -0,0 +1,10 @@ +{{ partial "header.html" . }} +{{ if .Content }} +{{ .Content }} +{{ else }} +{{ with (index (index .Site.Sections .Section) 0) }} +{{ .Page.Content }} +{{ $.Scratch.Set "uniqueId" .Page.UniqueID }} +{{ end }} +{{ end }} +{{ partial "footer.html" . }} diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index c07802bcc3..76d197f506 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -1,14 +1,55 @@ - {{ if .Params.chapter }} + {{ $isChapter := or (eq .Kind "section") (.Params.chapter)}} + {{ if $isChapter }} {{ end }} + {{ 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 }} +
diff --git a/layouts/partials/header.html b/layouts/partials/header.html index 7a34089eb4..c61851a5fe 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -22,6 +22,7 @@ {{ partial "style.html" . }} + {{ $isChapter := or (eq .Kind "section") (.Params.chapter)}} {{ partial "menu.html" . }}- {{ printf "Unknown section '%s' found in site menu" $key }} -