theme: remove output format from nested content handling #891

This commit is contained in:
Sören Weber 2024-08-27 08:53:03 +02:00
parent ff5a016c23
commit 4eec133b35
No known key found for this signature in database
GPG key ID: BEC6D55545451B6D
3 changed files with 6 additions and 6 deletions

View file

@ -3,8 +3,8 @@
{{- $outputFormat := .outputFormat | default (partial "output-format.hugo" $page) }}
{{- range $k, $v := $page.Site.Params.relearn.dependencies }}
{{- $has := printf "has%s" $v.name }}
{{- $nestedhas := printf "nestedHas%s" $v.name }}
{{- $wants := or ($page.Page.Store.Get $has) (and ($page.Page.Store.Get (printf "%sIsNested" $outputFormat)) ($page.Page.Store.Get $nestedhas)) }}
{{- $hasnested := printf "relearnHasNested%s" $v.name }}
{{- $wants := or ($page.Page.Store.Get $has) (and ($page.Page.Store.Get "relearnIsNested") ($page.Page.Store.Get $hasnested)) }}
{{- if and $wants }}
{{- if $v.location }}
{{- warnf "DEPRECATED parameter 'location' for dependency '%s' configured in your hugo.toml, query the 'location' parameter inside your dependency loader instead; see https://mcshelby.github.io/hugo-theme-relearn/basics/migration#5270" $k}}

View file

@ -1,6 +1,6 @@
{{- $page := .page }}
{{- $outputFormat := .outputFormat }}
{{- $page.Page.Store.Set (printf "%sIsNested" $outputFormat) true }}
{{- $page.Page.Store.Set "relearnIsNested" true }}
{{- with $page }}
{{- $currentNode := . }}
{{- $pages := partial "pageHelper/pagesBy.html" (dict "page" .) }}
@ -50,8 +50,8 @@
{{- partialCached "nested-content.hugo" (dict "page" $page "outputFormat" $outputFormat) $page.RelPermalink "outputFormat" $outputFormat }}
{{- range $page.Site.Params.relearn.dependencies }}
{{- $has := printf "has%s" .name }}
{{- $nestedhas := printf "nestedHas%s" .name }}
{{- $currentNode.Page.Store.Set $nestedhas (or ($currentNode.Page.Store.Get $nestedhas) ($page.Page.Store.Get $has)) }}
{{- $hasnested := printf "relearnHasNested%s" .name }}
{{- $currentNode.Page.Store.Set $hasnested (or ($currentNode.Page.Store.Get $hasnested) ($page.Page.Store.Get $has)) }}
{{- end }}
{{- end }}
{{- end }}

View file

@ -1,5 +1,5 @@
{{- $page := .page }}
{{- $content := .content }}
{{- $outputFormat := .outputFormat }}
{{- $page.Page.Store.Set (printf "%sIsNested" $outputFormat) false }}
{{- $page.Page.Store.Set "relearnIsNested" false }}
{{- partial "output-partial.hugo" (dict "base" "article" "page" $page "parameter" (dict "page" $page "content" $content "outputFormat" $outputFormat) "outputFormat" $outputFormat) }}