2024-08-29 00:32:21 +02:00
|
|
|
{{- .Store.Set "relearnIsNested" true }}
|
|
|
|
{{- template "section-tree-print" dict "sect" . "currentnode" . }}
|
2022-07-09 10:37:39 +02:00
|
|
|
{{- define "section-tree-print" }}
|
|
|
|
{{- $currentNode := .currentnode }}
|
|
|
|
{{- $currentFileRelPermalink := .currentnode.RelPermalink }}
|
|
|
|
{{- with .sect }}
|
|
|
|
{{- $isSelf := eq .RelPermalink $currentFileRelPermalink }}
|
|
|
|
{{- $isAncestor := and (not $isSelf) (.IsAncestor $currentNode) }}
|
2024-08-29 23:50:31 +02:00
|
|
|
{{- $pages := partialCached "_relearn/pages.gotmpl" (dict "page" .) .Path }}
|
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 }}
|
2024-08-27 09:31:26 +02:00
|
|
|
{{- template "section-print" dict "sect" . "currentnode" $currentNode }}
|
2023-05-18 00:12:47 +02:00
|
|
|
{{- 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 }}
|
2024-08-27 09:31:26 +02:00
|
|
|
{{- template "section-tree-print" dict "sect" . "currentnode" $currentNode }}
|
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 }}
|
|
|
|
{{- with .sect }}
|
2022-07-10 01:25:38 +02:00
|
|
|
{{- $page := . }}
|
2024-08-29 23:50:31 +02:00
|
|
|
{{- partialCached "_relearn/nestedContent.gotmpl" $page $page.Path }}
|
2023-10-09 17:42:51 +02:00
|
|
|
{{- range $page.Site.Params.relearn.dependencies }}
|
|
|
|
{{- $has := printf "has%s" .name }}
|
2024-08-27 08:53:03 +02:00
|
|
|
{{- $hasnested := printf "relearnHasNested%s" .name }}
|
|
|
|
{{- $currentNode.Page.Store.Set $hasnested (or ($currentNode.Page.Store.Get $hasnested) ($page.Page.Store.Get $has)) }}
|
2024-08-29 12:28:34 +02:00
|
|
|
{{- end }}
|
2022-07-09 10:37:39 +02:00
|
|
|
{{- end }}
|
2024-08-29 00:32:21 +02:00
|
|
|
{{- end }}
|