2022-07-09 14:38:28 +00:00
|
|
|
{{- $page := .page }}
|
2022-11-13 09:55:17 +00:00
|
|
|
{{- $outputFormat := .outputFormat }}
|
|
|
|
{{- $page.Page.Store.Set (printf "%sIsNested" $outputFormat) true }}
|
2022-07-09 14:38:28 +00:00
|
|
|
{{- with $page }}
|
|
|
|
{{- $currentNode := . }}
|
2023-05-17 22:12:47 +00:00
|
|
|
{{- $pages := .Pages }}
|
2022-07-09 14:38:28 +00:00
|
|
|
{{- $defaultOrdersectionsby := .Site.Params.ordersectionsby | default "weight" }}
|
2023-05-17 22:12:47 +00:00
|
|
|
{{- $currentOrdersectionsby := .Params.ordersectionsby | default $defaultOrdersectionsby }}
|
|
|
|
{{- template "section-print" dict "sect" . "currentnode" $currentNode "outputFormat" $outputFormat }}
|
|
|
|
{{- if $pages }}
|
|
|
|
<section>
|
|
|
|
<h1 class="a11y-only">{{ T "Subsections" .Title }}</h1>
|
|
|
|
{{- end }}
|
|
|
|
{{- if eq $currentOrdersectionsby "title" }}
|
|
|
|
{{- range $pages.ByTitle }}
|
|
|
|
{{- template "section-tree-print" dict "sect" . "currentnode" $currentNode "outputFormat" $outputFormat }}
|
2022-07-09 14:38:28 +00:00
|
|
|
{{- end }}
|
2023-05-17 22:12:47 +00:00
|
|
|
{{- else }}
|
|
|
|
{{- range $pages.ByWeight }}
|
|
|
|
{{- template "section-tree-print" dict "sect" . "currentnode" $currentNode "outputFormat" $outputFormat }}
|
2022-07-09 08:37:39 +00:00
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|
2023-05-17 22:12:47 +00:00
|
|
|
{{- if $pages }}
|
|
|
|
</section>
|
|
|
|
{{- end }}
|
2022-07-09 08:37:39 +00:00
|
|
|
{{- end }}
|
|
|
|
{{- define "section-tree-print" }}
|
|
|
|
{{- $currentNode := .currentnode }}
|
2022-11-13 09:55:17 +00:00
|
|
|
{{- $outputFormat := .outputFormat }}
|
2022-07-09 08:37:39 +00:00
|
|
|
{{- $currentFileRelPermalink := .currentnode.RelPermalink }}
|
|
|
|
{{- with .sect }}
|
|
|
|
{{- $isSelf := eq .RelPermalink $currentFileRelPermalink }}
|
|
|
|
{{- $isAncestor := and (not $isSelf) (.IsAncestor $currentNode) }}
|
|
|
|
{{- $pages := .Pages }}
|
|
|
|
{{- $relearnIsHiddenFrom := index ($currentNode.Scratch.Get "relearnIsHiddenFrom") .RelPermalink }}
|
|
|
|
{{- $hidden := and $relearnIsHiddenFrom (not $.showhidden) (not $isSelf) (not $isAncestor) }}
|
|
|
|
{{- if $hidden }}
|
2022-11-12 19:58:43 +00:00
|
|
|
{{- else }}
|
2022-07-09 08:37:39 +00:00
|
|
|
{{- $defaultOrdersectionsby := .Site.Params.ordersectionsby | default "weight" }}
|
|
|
|
{{- $currentOrdersectionsby := .Params.ordersectionsby | default $defaultOrdersectionsby }}
|
2023-05-17 22:12:47 +00:00
|
|
|
{{- template "section-print" dict "sect" . "currentnode" $currentNode "outputFormat" $outputFormat }}
|
|
|
|
{{- if $pages }}
|
2022-07-09 08:37:39 +00:00
|
|
|
<section>
|
2022-10-07 18:45:14 +00:00
|
|
|
<h1 class="a11y-only">{{ T "Subsections" .Title }}</h1>
|
2022-07-09 08:37:39 +00:00
|
|
|
{{- end }}
|
|
|
|
{{- if eq $currentOrdersectionsby "title" }}
|
|
|
|
{{- range $pages.ByTitle }}
|
2023-05-17 22:12:47 +00:00
|
|
|
{{- template "section-tree-print" dict "sect" . "currentnode" $currentNode "outputFormat" $outputFormat }}
|
2022-07-09 08:37:39 +00:00
|
|
|
{{- end }}
|
|
|
|
{{- else }}
|
|
|
|
{{- range $pages.ByWeight }}
|
2023-05-17 22:12:47 +00:00
|
|
|
{{- template "section-tree-print" dict "sect" . "currentnode" $currentNode "outputFormat" $outputFormat }}
|
2022-07-09 08:37:39 +00:00
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|
2023-05-17 22:12:47 +00:00
|
|
|
{{- if $pages }}
|
2022-07-09 08:37:39 +00:00
|
|
|
</section>
|
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|
|
|
|
{{- define "section-print" }}
|
|
|
|
{{- $currentNode := .currentnode }}
|
2022-11-13 09:55:17 +00:00
|
|
|
{{- $outputFormat := .outputFormat }}
|
2022-07-09 08:37:39 +00:00
|
|
|
{{- with .sect }}
|
2022-07-09 23:25:38 +00:00
|
|
|
{{- $page := . }}
|
2022-11-13 15:36:40 +00:00
|
|
|
{{- partialCached "nested-content.hugo" (dict "page" $page "outputFormat" $outputFormat) $page.RelPermalink "outputFormat" $outputFormat }}
|
2022-07-11 21:52:59 +00:00
|
|
|
{{- $currentNode.Page.Store.Set "nestedHasMathJax" (or ($currentNode.Page.Store.Get "nestedHasMathJax") (.Page.Store.Get "hasMathJax")) }}
|
|
|
|
{{- $currentNode.Page.Store.Set "nestedHasMermaid" (or ($currentNode.Page.Store.Get "nestedHasMermaid") (.Page.Store.Get "hasMermaid")) }}
|
2023-05-14 21:05:07 +00:00
|
|
|
{{- $currentNode.Page.Store.Set "nestedHasOpenapi" (or ($currentNode.Page.Store.Get "nestedHasOpenapi") (.Page.Store.Get "hasOpenapi")) }}
|
2022-07-09 08:37:39 +00:00
|
|
|
{{- end }}
|
2023-05-17 22:12:47 +00:00
|
|
|
{{- end }}
|