Fix hugo build with Hugo 0.146.7+: override recursive partialCached calls
This commit is contained in:
parent
0c3e81bc0f
commit
5f85f51ddd
2 changed files with 410 additions and 0 deletions
33
layouts/partials/bodys/tree.html
Normal file
33
layouts/partials/bodys/tree.html
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
{{- .Store.Set "relearnIsNested" true }}
|
||||
{{- partial "inline/article-walker" . .Path | safeHTML }}
|
||||
|
||||
{{- define "partials/inline/article-walker" }}
|
||||
{{- $html := "" }}
|
||||
{{- $pages := partialCached "_relearn/pages.gotmpl" (dict "page" .) .Path }}
|
||||
{{- range $pages }}
|
||||
{{- if not (partialCached "_relearn/pageIsHidden.gotmpl" . .Path) }}
|
||||
{{- $html = printf "%s%s" $html (partial "inline/article-walker" . .Path) }}
|
||||
{{- $child := . }}
|
||||
{{- range .Site.Params.relearn.dependencies }}
|
||||
{{- $has := printf "has%s" .name }}
|
||||
{{- $hasnested := printf "relearnHasNested%s" .name }}
|
||||
{{- $.Store.Set $hasnested (or ($.Store.Get $hasnested) ($child.Store.Get $hasnested) ($child.Store.Get $has)) }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{- $article := "" }}
|
||||
{{- if .Title }}
|
||||
{{- $article = .Render "article" }}
|
||||
{{- end }}
|
||||
{{- if len $html }}
|
||||
{{- $title := partial "title.gotmpl" (dict "page" . "linkTitle" true) }}
|
||||
{{- $html = printf `%s
|
||||
<section>
|
||||
<h1 class="a11y-only">%s</h1>%s
|
||||
</section>` $article (T "Subsections" $title | htmlEscape) $html }}
|
||||
{{- else }}
|
||||
{{- $html = $article }}
|
||||
{{- end }}
|
||||
{{- return $html }}
|
||||
{{- end }}
|
||||
Loading…
Add table
Add a link
Reference in a new issue