Add nested sections

master
Will Faught 2 years ago
parent 0fdda5ed86
commit a3c335a9a9

@ -755,6 +755,10 @@ Page identifiers:
<dd>The article.</dd> <dd>The article.</dd>
<dt><code>#paige-authors</code></dt> <dt><code>#paige-authors</code></dt>
<dd>The authors.</dd> <dd>The authors.</dd>
<dt><code>#paige-collections</code></dt>
<dd>The collections.</dd>
<dt><code>#paige-collections-header</code></dt>
<dd>The collections header.</dd>
<dt><code>#paige-comments</code></dt> <dt><code>#paige-comments</code></dt>
<dd>The comments.</dd> <dd>The comments.</dd>
<dt><code>#paige-content</code></dt> <dt><code>#paige-content</code></dt>
@ -783,10 +787,16 @@ Page identifiers:
<dd>The reading time.</dd> <dd>The reading time.</dd>
<dt><code>#paige-root</code></dt> <dt><code>#paige-root</code></dt>
<dd>The outermost element in the body.</dd> <dd>The outermost element in the body.</dd>
<dt><code>#paige-sections</code></dt>
<dd>The sections.</dd>
<dt><code>#paige-sections-header</code></dt>
<dd>The sections header.</dd>
<dt><code>#paige-series</code></dt> <dt><code>#paige-series</code></dt>
<dd>The series.</dd> <dd>The series.</dd>
<dt><code>#paige-subpages</code></dt> <dt><code>#paige-subpages</code></dt>
<dd>The sub-pages.</dd> <dd>The sub-pages.</dd>
<dt><code>#paige-subpages-header</code></dt>
<dd>The sub-pages header.</dd>
<dt><code>#paige-title</code></dt> <dt><code>#paige-title</code></dt>
<dd>The title.</dd> <dd>The title.</dd>
<dt><code>#paige-toc</code></dt> <dt><code>#paige-toc</code></dt>

@ -0,0 +1,4 @@
---
description: "Browse by author."
title: "Authors"
---

@ -0,0 +1,4 @@
---
description: "Browse by category."
title: "Categories"
---

@ -1,4 +1,5 @@
--- ---
description: "Search the site."
layout: "paige/search" layout: "paige/search"
title: "Search" title: "Search"
--- ---

@ -0,0 +1,4 @@
---
description: "Browse by series."
title: "Series"
---

@ -0,0 +1,4 @@
---
description: "Browse by tag."
title: "Tags"
---

@ -5,12 +5,12 @@
#paige-reading-time, #paige-reading-time,
#paige-series, #paige-series,
#paige-toc, #paige-toc,
#paige-subpages .paige-authors, .paige-authors,
#paige-subpages .paige-date, .paige-date,
#paige-subpages .paige-date-header, .paige-date-header,
#paige-subpages .paige-keywords, .paige-keywords,
#paige-subpages .paige-reading-time, .paige-reading-time,
#paige-subpages .paige-series, .paige-series,
#paige-subpages .paige-summary { .paige-summary {
display: none; display: none;
} }

@ -1,3 +1,6 @@
paige_collections:
other: Sammlungen
paige_figure: paige_figure:
other: Abbildung other: Abbildung
@ -14,6 +17,9 @@ paige_minutes:
paige_noscript: paige_noscript:
other: JavaScript wird benötigt. other: JavaScript wird benötigt.
paige_pages:
other: Seiten
paige_search_button: paige_search_button:
other: Suche other: Suche
@ -31,3 +37,6 @@ paige_search_searching:
paige_search_something: paige_search_something:
other: Die Suche lieferte einige Treffer other: Die Suche lieferte einige Treffer
paige_sections:
other: Abschnitte

@ -1,3 +1,6 @@
paige_collections:
other: Collections
paige_figure: paige_figure:
other: Figure other: Figure
@ -14,6 +17,9 @@ paige_minutes:
paige_noscript: paige_noscript:
other: JavaScript is required. other: JavaScript is required.
paige_pages:
other: Pages
paige_search_button: paige_search_button:
other: Search other: Search
@ -31,3 +37,6 @@ paige_search_searching:
paige_search_something: paige_search_something:
other: Something found other: Something found
paige_sections:
other: Sections

@ -1,9 +1,41 @@
{{ $page := . }} {{ $page := . }}
{{ if $page.Pages }} {{ $collections := cond $page.IsHome site.Taxonomies slice }}
{{ $sections := where $page.Pages "Kind" "section" }}
{{ $pages := where $page.Pages "Kind" "in" (slice "page" "term") }}
{{ with $collections }}
<div id="paige-collections">
{{ if or $sections $pages }}
<h2 class="h4 text-center" id="paige-collections-header">{{ i18n "paige_collections" }}</h2>
{{ end }}
{{ range $k, $v := . }}
{{ partial "paige/subpage.html" (site.GetPage $k) }}
{{ end }}
</div>
{{ end }}
{{ with $sections }}
<div id="paige-sections">
{{ if or $collections $pages }}
<h2 class="h4 text-center" id="paige-sections-header">{{ i18n "paige_sections" }}</h2>
{{ end }}
{{ range . }}
{{ partial "paige/subpage.html" . }}
{{ end }}
</div>
{{ end }}
{{ with $pages }}
{{ if $page.Param "paige.section_pages.full_pages" }} {{ if $page.Param "paige.section_pages.full_pages" }}
{{ $pager := $page.Paginate $page.Pages }} {{ $pager := $page.Paginate . }}
<div id="paige-subpages"> <div id="paige-subpages">
{{ if or $collections $sections }}
<h2 class="h4 text-center" id="paige-subpages-header">{{ i18n "paige_pages" }}</h2>
{{ end }}
{{ range $pager.Pages }} {{ range $pager.Pages }}
{{ partial "paige/article.html" (dict "fullpages" true "page" .) }} {{ partial "paige/article.html" (dict "fullpages" true "page" .) }}
{{ end }} {{ end }}
@ -18,24 +50,29 @@
{{ end }} {{ end }}
{{ else }} {{ else }}
<div id="paige-subpages"> <div id="paige-subpages">
{{ $pinned := where $page.Pages "Params.paige.pin" true }} {{ if or $collections $sections }}
<h2 class="h4 text-center" id="paige-subpages-header">{{ i18n "paige_pages" }}</h2>
{{ end }}
{{ $pinned := where . "Params.paige.pin" true }}
{{ range $pinned.ByPublishDate.Reverse }} {{ range $pinned.ByPublishDate.Reverse }}
{{ partial "paige/subpage.html" . }} {{ partial "paige/subpage.html" . }}
{{ end }} {{ end }}
{{ $unpinned := complement $pinned $page.Pages }} {{ $unpinned := complement $pinned . }}
{{ $pagegroups := $unpinned.ByPublishDate.Reverse.GroupByPublishDate "January 2006" }} {{ $pagegroups := $unpinned.ByPublishDate.Reverse.GroupByPublishDate "January 2006" }}
{{ $pager := $page.Paginate $pagegroups }} {{ $pager := $page.Paginate $pagegroups }}
{{ range $pager.PageGroups }} {{ range $pager.PageGroups }}
<p class="h5 paige-date-header text-center">{{ .Key }}</p> <h3 class="h5 paige-date-header text-center">{{ .Key }}</h3>
{{ range .Pages }} {{ range .Pages }}
{{ partial "paige/subpage.html" . }} {{ partial "paige/subpage.html" . }}
{{ end }} {{ end }}
{{ end }} {{ end }}
</div> </div>
{{ if or $pager.HasPrev $pager.HasNext }} {{ if or $pager.HasPrev $pager.HasNext }}
<div id="paige-pagination"> <div id="paige-pagination">
<div class="d-flex justify-content-center"> <div class="d-flex justify-content-center">

Loading…
Cancel
Save