theme: remove unnessecary reference to sections #434

- code works if simply .Pages is used
- this also fixes ordering issues in the RSS feed
This commit is contained in:
Sören Weber 2023-01-22 22:18:09 +01:00
parent 0c10cc8af3
commit 1ee561fd77
No known key found for this signature in database
GPG key ID: BEC6D55545451B6D
5 changed files with 0 additions and 21 deletions

View file

@ -1,8 +1,5 @@
{{- partialCached "page-meta.hugo" . .RelPermalink }} {{- partialCached "page-meta.hugo" . .RelPermalink }}
{{- $pages := .Page.Pages }} {{- $pages := .Page.Pages }}
{{- if .Page.Sections}}
{{- $pages = (.Page.Pages | union .Page.Sections) }}
{{- end }}
{{- $limit := .Site.Config.Services.RSS.Limit -}} {{- $limit := .Site.Config.Services.RSS.Limit -}}
{{- if ge $limit 0 -}} {{- if ge $limit 0 -}}
{{- $pages = $pages | first $limit -}} {{- $pages = $pages | first $limit -}}

View file

@ -134,9 +134,6 @@
{{- $isAncestor := and (not $isSelf) (.IsAncestor $currentNode) }} {{- $isAncestor := and (not $isSelf) (.IsAncestor $currentNode) }}
{{- $isActive := $isSelf }} {{- $isActive := $isSelf }}
{{- $pages := .Pages }} {{- $pages := .Pages }}
{{- if .Sections}}
{{- $pages = (.Pages | union .Sections) }}
{{- end }}
{{- $relearnIsHiddenFrom := index ($currentNode.Scratch.Get "relearnIsHiddenFrom") .RelPermalink }} {{- $relearnIsHiddenFrom := index ($currentNode.Scratch.Get "relearnIsHiddenFrom") .RelPermalink }}
{{- $hidden := and $relearnIsHiddenFrom (not $.showhidden) (not $isSelf) (not $isAncestor) }} {{- $hidden := and $relearnIsHiddenFrom (not $.showhidden) (not $isSelf) (not $isAncestor) }}
{{- if $hidden }} {{- if $hidden }}

View file

@ -15,9 +15,6 @@
{{- end }} {{- end }}
{{- end }} {{- end }}
{{- $pages := .Site.Home.Pages }} {{- $pages := .Site.Home.Pages }}
{{- if .Site.Home.Sections}}
{{- $pages = (.Site.Home.Pages | union .Site.Home.Sections) }}
{{- end }}
{{- $defaultOrdersectionsby := .Site.Params.ordersectionsby | default "weight" }} {{- $defaultOrdersectionsby := .Site.Params.ordersectionsby | default "weight" }}
{{- $currentOrdersectionsby := .Site.Home.Params.ordersectionsby | default $defaultOrdersectionsby }} {{- $currentOrdersectionsby := .Site.Home.Params.ordersectionsby | default $defaultOrdersectionsby }}
{{- if $isShortcut }} {{- if $isShortcut }}
@ -56,9 +53,6 @@
{{- $isAncestor := and (not $isSelf) (.IsAncestor $currentNode) }} {{- $isAncestor := and (not $isSelf) (.IsAncestor $currentNode) }}
{{- $isActive = or $isSelf $isActive }} {{- $isActive = or $isSelf $isActive }}
{{- $pages := .Pages }} {{- $pages := .Pages }}
{{- if .Sections}}
{{- $pages = (.Pages | union .Sections) }}
{{- end }}
{{- $relearnIsHiddenFrom := index ($currentNode.Scratch.Get "relearnIsHiddenFrom") .RelPermalink }} {{- $relearnIsHiddenFrom := index ($currentNode.Scratch.Get "relearnIsHiddenFrom") .RelPermalink }}
{{- $hidden := and $relearnIsHiddenFrom (not $.showhidden) (not $isSelf) (not $isAncestor) }} {{- $hidden := and $relearnIsHiddenFrom (not $.showhidden) (not $isSelf) (not $isAncestor) }}
{{- if $hidden }} {{- if $hidden }}

View file

@ -52,9 +52,6 @@
{{- end }} {{- end }}
{{- $pages := .node.Pages }} {{- $pages := .node.Pages }}
{{- if .node.Sections }}
{{- $pages = (.node.Pages | union .node.Sections) }}
{{- end }}
{{- $defaultOrdersectionsby := .defaultOrdersectionsby }} {{- $defaultOrdersectionsby := .defaultOrdersectionsby }}
{{- $currentOrdersectionsby := .node.Params.ordersectionsby | default $defaultOrdersectionsby }} {{- $currentOrdersectionsby := .node.Params.ordersectionsby | default $defaultOrdersectionsby }}
{{- if eq $currentOrdersectionsby "title"}} {{- if eq $currentOrdersectionsby "title"}}

View file

@ -18,9 +18,6 @@
{{- with $context }} {{- with $context }}
{{ (printf "<%s class=\"children children-%s children-sort-%s\">" $containerstyle $style $sortTerm)|safeHTML }} {{ (printf "<%s class=\"children children-%s children-sort-%s\">" $containerstyle $style $sortTerm)|safeHTML }}
{{- $pages := .Page.Pages }} {{- $pages := .Page.Pages }}
{{- if .Page.Sections}}
{{- $pages = (.Page.Pages | union .Page.Sections) }}
{{- end }}
{{- $defaultOrdersectionsby := .Site.Params.ordersectionsby | default "weight" }} {{- $defaultOrdersectionsby := .Site.Params.ordersectionsby | default "weight" }}
{{- $currentOrdersectionsby := $sortTerm | default (.Page.Params.ordersectionsby | default $defaultOrdersectionsby) }} {{- $currentOrdersectionsby := $sortTerm | default (.Page.Params.ordersectionsby | default $defaultOrdersectionsby) }}
@ -87,9 +84,6 @@
{{- end }} {{- end }}
{{- $pages := .Page.Pages }} {{- $pages := .Page.Pages }}
{{- if .Page.Sections}}
{{- $pages = (.Page.Pages | union .Page.Sections) }}
{{- end }}
{{- $defaultOrdersectionsby := .Site.Params.ordersectionsby | default "weight" }} {{- $defaultOrdersectionsby := .Site.Params.ordersectionsby | default "weight" }}
{{- $currentOrdersectionsby := $.sortTerm | default (.Page.Params.ordersectionsby | default $defaultOrdersectionsby) }} {{- $currentOrdersectionsby := $.sortTerm | default (.Page.Params.ordersectionsby | default $defaultOrdersectionsby) }}