2022-07-09 16:38:28 +02:00
|
|
|
{{- $page := .page }}
|
2022-11-13 10:55:17 +01:00
|
|
|
{{- $outputFormat := .outputFormat }}
|
|
|
|
{{- $page.Page.Store.Set (printf "%sIsNested" $outputFormat) true }}
|
2022-07-09 16:38:28 +02:00
|
|
|
{{- with $page }}
|
|
|
|
{{- $currentNode := . }}
|
2023-10-12 23:08:58 +02:00
|
|
|
{{- $pages := partial "pageHelper/pagesBy.html" (dict "page" . "hidden" true) }}
|
2023-05-18 00:12:47 +02:00
|
|
|
{{- template "section-print" dict "sect" . "currentnode" $currentNode "outputFormat" $outputFormat }}
|
|
|
|
{{- if $pages }}
|
|
|
|
<section>
|
|
|
|
<h1 class="a11y-only">{{ T "Subsections" .Title }}</h1>
|
|
|
|
{{- end }}
|
2023-10-12 23:08:58 +02:00
|
|
|
{{- range $pages }}
|
|
|
|
{{- template "section-tree-print" dict "sect" . "currentnode" $currentNode "outputFormat" $outputFormat }}
|
2022-07-09 10:37:39 +02:00
|
|
|
{{- end }}
|
2023-05-18 00:12:47 +02:00
|
|
|
{{- if $pages }}
|
|
|
|
</section>
|
|
|
|
{{- end }}
|
2022-07-09 10:37:39 +02:00
|
|
|
{{- end }}
|
|
|
|
{{- define "section-tree-print" }}
|
|
|
|
{{- $currentNode := .currentnode }}
|
2022-11-13 10:55:17 +01:00
|
|
|
{{- $outputFormat := .outputFormat }}
|
2022-07-09 10:37:39 +02:00
|
|
|
{{- $currentFileRelPermalink := .currentnode.RelPermalink }}
|
|
|
|
{{- with .sect }}
|
|
|
|
{{- $isSelf := eq .RelPermalink $currentFileRelPermalink }}
|
|
|
|
{{- $isAncestor := and (not $isSelf) (.IsAncestor $currentNode) }}
|
2023-10-12 23:08:58 +02:00
|
|
|
{{- $pages := partial "pageHelper/pagesBy.html" (dict "page" . "hidden" true) }}
|
2022-07-09 10:37:39 +02:00
|
|
|
{{- $relearnIsHiddenFrom := index ($currentNode.Scratch.Get "relearnIsHiddenFrom") .RelPermalink }}
|
|
|
|
{{- $hidden := and $relearnIsHiddenFrom (not $.showhidden) (not $isSelf) (not $isAncestor) }}
|
|
|
|
{{- if $hidden }}
|
2022-11-12 20:58:43 +01:00
|
|
|
{{- else }}
|
2023-05-18 00:12:47 +02:00
|
|
|
{{- template "section-print" dict "sect" . "currentnode" $currentNode "outputFormat" $outputFormat }}
|
|
|
|
{{- if $pages }}
|
2022-07-09 10:37:39 +02:00
|
|
|
<section>
|
2022-10-07 20:45:14 +02:00
|
|
|
<h1 class="a11y-only">{{ T "Subsections" .Title }}</h1>
|
2022-07-09 10:37:39 +02:00
|
|
|
{{- end }}
|
2023-10-12 23:08:58 +02:00
|
|
|
{{- range $pages }}
|
|
|
|
{{- template "section-tree-print" dict "sect" . "currentnode" $currentNode "outputFormat" $outputFormat }}
|
2022-07-09 10:37:39 +02:00
|
|
|
{{- end }}
|
2023-05-18 00:12:47 +02:00
|
|
|
{{- if $pages }}
|
2022-07-09 10:37:39 +02:00
|
|
|
</section>
|
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|
|
|
|
{{- define "section-print" }}
|
|
|
|
{{- $currentNode := .currentnode }}
|
2022-11-13 10:55:17 +01:00
|
|
|
{{- $outputFormat := .outputFormat }}
|
2022-07-09 10:37:39 +02:00
|
|
|
{{- with .sect }}
|
2022-07-10 01:25:38 +02:00
|
|
|
{{- $page := . }}
|
2022-11-13 16:36:40 +01:00
|
|
|
{{- partialCached "nested-content.hugo" (dict "page" $page "outputFormat" $outputFormat) $page.RelPermalink "outputFormat" $outputFormat }}
|
2023-10-09 17:42:51 +02:00
|
|
|
{{- range $page.Site.Params.relearn.dependencies }}
|
|
|
|
{{- $has := printf "has%s" .name }}
|
|
|
|
{{- $nestedhas := printf "nestedHas%s" .name }}
|
|
|
|
{{- $currentNode.Page.Store.Set $nestedhas (or ($currentNode.Page.Store.Get $nestedhas) ($page.Page.Store.Get $has)) }}
|
|
|
|
{{- end }}
|
2022-07-09 10:37:39 +02:00
|
|
|
{{- end }}
|
2023-05-18 00:12:47 +02:00
|
|
|
{{- end }}
|