Add nested sections
This commit is contained in:
10
README.md
10
README.md
@@ -755,6 +755,10 @@ Page identifiers:
|
||||
<dd>The article.</dd>
|
||||
<dt><code>#paige-authors</code></dt>
|
||||
<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>
|
||||
<dd>The comments.</dd>
|
||||
<dt><code>#paige-content</code></dt>
|
||||
@@ -783,10 +787,16 @@ Page identifiers:
|
||||
<dd>The reading time.</dd>
|
||||
<dt><code>#paige-root</code></dt>
|
||||
<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>
|
||||
<dd>The series.</dd>
|
||||
<dt><code>#paige-subpages</code></dt>
|
||||
<dd>The sub-pages.</dd>
|
||||
<dt><code>#paige-subpages-header</code></dt>
|
||||
<dd>The sub-pages header.</dd>
|
||||
<dt><code>#paige-title</code></dt>
|
||||
<dd>The title.</dd>
|
||||
<dt><code>#paige-toc</code></dt>
|
||||
|
4
exampleSite/content/authors/_index.md
Normal file
4
exampleSite/content/authors/_index.md
Normal file
@@ -0,0 +1,4 @@
|
||||
---
|
||||
description: "Browse by author."
|
||||
title: "Authors"
|
||||
---
|
4
exampleSite/content/categories/_index.md
Normal file
4
exampleSite/content/categories/_index.md
Normal file
@@ -0,0 +1,4 @@
|
||||
---
|
||||
description: "Browse by category."
|
||||
title: "Categories"
|
||||
---
|
@@ -1,4 +1,5 @@
|
||||
---
|
||||
description: "Search the site."
|
||||
layout: "paige/search"
|
||||
title: "Search"
|
||||
---
|
||||
|
4
exampleSite/content/series/_index.md
Normal file
4
exampleSite/content/series/_index.md
Normal file
@@ -0,0 +1,4 @@
|
||||
---
|
||||
description: "Browse by series."
|
||||
title: "Series"
|
||||
---
|
4
exampleSite/content/tags/_index.md
Normal file
4
exampleSite/content/tags/_index.md
Normal file
@@ -0,0 +1,4 @@
|
||||
---
|
||||
description: "Browse by tag."
|
||||
title: "Tags"
|
||||
---
|
@@ -5,12 +5,12 @@
|
||||
#paige-reading-time,
|
||||
#paige-series,
|
||||
#paige-toc,
|
||||
#paige-subpages .paige-authors,
|
||||
#paige-subpages .paige-date,
|
||||
#paige-subpages .paige-date-header,
|
||||
#paige-subpages .paige-keywords,
|
||||
#paige-subpages .paige-reading-time,
|
||||
#paige-subpages .paige-series,
|
||||
#paige-subpages .paige-summary {
|
||||
.paige-authors,
|
||||
.paige-date,
|
||||
.paige-date-header,
|
||||
.paige-keywords,
|
||||
.paige-reading-time,
|
||||
.paige-series,
|
||||
.paige-summary {
|
||||
display: none;
|
||||
}
|
||||
|
@@ -1,3 +1,6 @@
|
||||
paige_collections:
|
||||
other: Sammlungen
|
||||
|
||||
paige_figure:
|
||||
other: Abbildung
|
||||
|
||||
@@ -14,6 +17,9 @@ paige_minutes:
|
||||
paige_noscript:
|
||||
other: JavaScript wird benötigt.
|
||||
|
||||
paige_pages:
|
||||
other: Seiten
|
||||
|
||||
paige_search_button:
|
||||
other: Suche
|
||||
|
||||
@@ -31,3 +37,6 @@ paige_search_searching:
|
||||
|
||||
paige_search_something:
|
||||
other: Die Suche lieferte einige Treffer
|
||||
|
||||
paige_sections:
|
||||
other: Abschnitte
|
||||
|
@@ -1,3 +1,6 @@
|
||||
paige_collections:
|
||||
other: Collections
|
||||
|
||||
paige_figure:
|
||||
other: Figure
|
||||
|
||||
@@ -14,6 +17,9 @@ paige_minutes:
|
||||
paige_noscript:
|
||||
other: JavaScript is required.
|
||||
|
||||
paige_pages:
|
||||
other: Pages
|
||||
|
||||
paige_search_button:
|
||||
other: Search
|
||||
|
||||
@@ -31,3 +37,6 @@ paige_search_searching:
|
||||
|
||||
paige_search_something:
|
||||
other: Something found
|
||||
|
||||
paige_sections:
|
||||
other: Sections
|
||||
|
@@ -1,9 +1,41 @@
|
||||
{{ $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" }}
|
||||
{{ $pager := $page.Paginate $page.Pages }}
|
||||
{{ $pager := $page.Paginate . }}
|
||||
<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 }}
|
||||
{{ partial "paige/article.html" (dict "fullpages" true "page" .) }}
|
||||
{{ end }}
|
||||
@@ -18,24 +50,29 @@
|
||||
{{ end }}
|
||||
{{ else }}
|
||||
<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 }}
|
||||
{{ partial "paige/subpage.html" . }}
|
||||
{{ end }}
|
||||
|
||||
{{ $unpinned := complement $pinned $page.Pages }}
|
||||
{{ $unpinned := complement $pinned . }}
|
||||
{{ $pagegroups := $unpinned.ByPublishDate.Reverse.GroupByPublishDate "January 2006" }}
|
||||
{{ $pager := $page.Paginate $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 }}
|
||||
{{ partial "paige/subpage.html" . }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</div>
|
||||
|
||||
{{ if or $pager.HasPrev $pager.HasNext }}
|
||||
<div id="paige-pagination">
|
||||
<div class="d-flex justify-content-center">
|
||||
|
Reference in New Issue
Block a user