mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-23 15:57:57 +00:00
39 lines
No EOL
1.6 KiB
HTML
39 lines
No EOL
1.6 KiB
HTML
{{- .Store.Set "relearnIsNested" true }}
|
|
{{- template "section-tree-print" dict "sect" . "currentnode" . }}
|
|
{{- define "section-tree-print" }}
|
|
{{- $currentNode := .currentnode }}
|
|
{{- $currentFileRelPermalink := .currentnode.RelPermalink }}
|
|
{{- with .sect }}
|
|
{{- $isSelf := eq .RelPermalink $currentFileRelPermalink }}
|
|
{{- $isAncestor := and (not $isSelf) (.IsAncestor $currentNode) }}
|
|
{{- $pages := partial "_relearn/pages.gotmpl" (dict "page" .) }}
|
|
{{- $relearnIsHiddenFrom := index ($currentNode.Scratch.Get "relearnIsHiddenFrom") .RelPermalink }}
|
|
{{- $hidden := and $relearnIsHiddenFrom (not $.showhidden) (not $isSelf) (not $isAncestor) }}
|
|
{{- if $hidden }}
|
|
{{- else }}
|
|
{{- template "section-print" dict "sect" . "currentnode" $currentNode }}
|
|
{{- if $pages }}
|
|
<section>
|
|
<h1 class="a11y-only">{{ T "Subsections" .Title }}</h1>
|
|
{{- end }}
|
|
{{- range $pages }}
|
|
{{- template "section-tree-print" dict "sect" . "currentnode" $currentNode }}
|
|
{{- end }}
|
|
{{- if $pages }}
|
|
</section>
|
|
{{- end }}
|
|
{{- end }}
|
|
{{- end }}
|
|
{{- end }}
|
|
{{- define "section-print" }}
|
|
{{- $currentNode := .currentnode }}
|
|
{{- with .sect }}
|
|
{{- $page := . }}
|
|
{{- partialCached "_relearn/nestedContent.gotmpl" $page $page.RelPermalink }}
|
|
{{- range $page.Site.Params.relearn.dependencies }}
|
|
{{- $has := printf "has%s" .name }}
|
|
{{- $hasnested := printf "relearnHasNested%s" .name }}
|
|
{{- $currentNode.Page.Store.Set $hasnested (or ($currentNode.Page.Store.Get $hasnested) ($page.Page.Store.Get $has)) }}
|
|
{{- end }}
|
|
{{- end }}
|
|
{{- end }} |