2022-07-09 14:38:28 +00:00
|
|
|
{{- $page := .page }}
|
2022-11-13 09:55:17 +00:00
|
|
|
{{- $outputFormat := .outputFormat }}
|
2024-08-27 06:53:03 +00:00
|
|
|
{{- $page.Page.Store.Set "relearnIsNested" true }}
|
2022-07-09 14:38:28 +00:00
|
|
|
{{- with $page }}
|
|
|
|
{{- $currentNode := . }}
|
2024-07-21 19:49:53 +00:00
|
|
|
{{- $pages := partial "pageHelper/pagesBy.html" (dict "page" .) }}
|
2023-05-17 22:12:47 +00: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 21:08:58 +00:00
|
|
|
{{- range $pages }}
|
|
|
|
{{- template "section-tree-print" dict "sect" . "currentnode" $currentNode "outputFormat" $outputFormat }}
|
2022-07-09 08:37:39 +00:00
|
|
|
{{- 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) }}
|
2024-07-21 19:49:53 +00:00
|
|
|
{{- $pages := partial "pageHelper/pagesBy.html" (dict "page" .) }}
|
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 }}
|
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 }}
|
2023-10-12 21:08:58 +00:00
|
|
|
{{- range $pages }}
|
|
|
|
{{- template "section-tree-print" dict "sect" . "currentnode" $currentNode "outputFormat" $outputFormat }}
|
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 }}
|
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 }}
|
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)) }}
|
2023-10-09 15:42:51 +00:00
|
|
|
{{- end }}
|
2022-07-09 08:37:39 +00:00
|
|
|
{{- end }}
|
2023-05-17 22:12:47 +00:00
|
|
|
{{- end }}
|