mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2025-01-18 19:00:24 +00:00
theme: remove output format from nested content handling #891
This commit is contained in:
parent
ff5a016c23
commit
4eec133b35
3 changed files with 6 additions and 6 deletions
|
@ -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}}
|
||||
|
|
|
@ -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 }}
|
||||
|
|
|
@ -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) }}
|
Loading…
Reference in a new issue