2024-08-28 22:32:21 +00:00
|
|
|
{{- .Store.Set "relearnIsNested" true }}
|
|
|
|
{{- template "section-tree-print" dict "sect" . "currentnode" . }}
|
2022-07-09 08:37:39 +00: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 21:50:31 +00:00
|
|
|
{{- $pages := partialCached "_relearn/pages.gotmpl" (dict "page" .) .Path }}
|
2022-07-09 08:37:39 +00:00
|
|
|
{{- $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 }}
|
2024-08-27 07:31:26 +00:00
|
|
|
{{- template "section-print" dict "sect" . "currentnode" $currentNode }}
|
2023-05-17 22:12:47 +00:00
|
|
|
{{- 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 }}
|
2023-10-12 21:08:58 +00:00
|
|
|
{{- range $pages }}
|
2024-08-27 07:31:26 +00:00
|
|
|
{{- template "section-tree-print" dict "sect" . "currentnode" $currentNode }}
|
2022-07-09 08:37:39 +00:00
|
|
|
{{- 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 }}
|
|
|
|
{{- with .sect }}
|
2022-07-09 23:25:38 +00:00
|
|
|
{{- $page := . }}
|
2024-08-29 21:50:31 +00:00
|
|
|
{{- partialCached "_relearn/nestedContent.gotmpl" $page $page.Path }}
|
2023-10-09 15:42:51 +00:00
|
|
|
{{- range $page.Site.Params.relearn.dependencies }}
|
|
|
|
{{- $has := printf "has%s" .name }}
|
2024-08-27 06:53:03 +00: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 10:28:34 +00:00
|
|
|
{{- end }}
|
2022-07-09 08:37:39 +00:00
|
|
|
{{- end }}
|
2024-08-28 22:32:21 +00:00
|
|
|
{{- end }}
|