From 1ee561fd7788b0bc953f7349cd456f577b3c0483 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Weber?= Date: Sun, 22 Jan 2023 22:18:09 +0100 Subject: [PATCH] theme: remove unnessecary reference to sections #434 - code works if simply .Pages is used - this also fixes ordering issues in the RSS feed --- layouts/_default/rss.xml | 3 --- layouts/partials/menu.html | 3 --- layouts/partials/nested-article.hugo | 6 ------ layouts/partials/page-meta.hugo | 3 --- layouts/partials/shortcodes/children.html | 6 ------ 5 files changed, 21 deletions(-) diff --git a/layouts/_default/rss.xml b/layouts/_default/rss.xml index 4951500e19..47a9cdb4f9 100644 --- a/layouts/_default/rss.xml +++ b/layouts/_default/rss.xml @@ -1,8 +1,5 @@ {{- partialCached "page-meta.hugo" . .RelPermalink }} {{- $pages := .Page.Pages }} -{{- if .Page.Sections}} - {{- $pages = (.Page.Pages | union .Page.Sections) }} -{{- end }} {{- $limit := .Site.Config.Services.RSS.Limit -}} {{- if ge $limit 0 -}} {{- $pages = $pages | first $limit -}} diff --git a/layouts/partials/menu.html b/layouts/partials/menu.html index 7e619c4a9d..6b35f57454 100644 --- a/layouts/partials/menu.html +++ b/layouts/partials/menu.html @@ -134,9 +134,6 @@ {{- $isAncestor := and (not $isSelf) (.IsAncestor $currentNode) }} {{- $isActive := $isSelf }} {{- $pages := .Pages }} - {{- if .Sections}} - {{- $pages = (.Pages | union .Sections) }} - {{- end }} {{- $relearnIsHiddenFrom := index ($currentNode.Scratch.Get "relearnIsHiddenFrom") .RelPermalink }} {{- $hidden := and $relearnIsHiddenFrom (not $.showhidden) (not $isSelf) (not $isAncestor) }} {{- if $hidden }} diff --git a/layouts/partials/nested-article.hugo b/layouts/partials/nested-article.hugo index 0b5aceac4f..8c01f28343 100644 --- a/layouts/partials/nested-article.hugo +++ b/layouts/partials/nested-article.hugo @@ -15,9 +15,6 @@ {{- end }} {{- end }} {{- $pages := .Site.Home.Pages }} - {{- if .Site.Home.Sections}} - {{- $pages = (.Site.Home.Pages | union .Site.Home.Sections) }} - {{- end }} {{- $defaultOrdersectionsby := .Site.Params.ordersectionsby | default "weight" }} {{- $currentOrdersectionsby := .Site.Home.Params.ordersectionsby | default $defaultOrdersectionsby }} {{- if $isShortcut }} @@ -56,9 +53,6 @@ {{- $isAncestor := and (not $isSelf) (.IsAncestor $currentNode) }} {{- $isActive = or $isSelf $isActive }} {{- $pages := .Pages }} - {{- if .Sections}} - {{- $pages = (.Pages | union .Sections) }} - {{- end }} {{- $relearnIsHiddenFrom := index ($currentNode.Scratch.Get "relearnIsHiddenFrom") .RelPermalink }} {{- $hidden := and $relearnIsHiddenFrom (not $.showhidden) (not $isSelf) (not $isAncestor) }} {{- if $hidden }} diff --git a/layouts/partials/page-meta.hugo b/layouts/partials/page-meta.hugo index 79193c2b64..eaf91672dc 100644 --- a/layouts/partials/page-meta.hugo +++ b/layouts/partials/page-meta.hugo @@ -52,9 +52,6 @@ {{- end }} {{- $pages := .node.Pages }} - {{- if .node.Sections }} - {{- $pages = (.node.Pages | union .node.Sections) }} - {{- end }} {{- $defaultOrdersectionsby := .defaultOrdersectionsby }} {{- $currentOrdersectionsby := .node.Params.ordersectionsby | default $defaultOrdersectionsby }} {{- if eq $currentOrdersectionsby "title"}} diff --git a/layouts/partials/shortcodes/children.html b/layouts/partials/shortcodes/children.html index bcd6c7a1a1..5e374e84ab 100644 --- a/layouts/partials/shortcodes/children.html +++ b/layouts/partials/shortcodes/children.html @@ -18,9 +18,6 @@ {{- with $context }} {{ (printf "<%s class=\"children children-%s children-sort-%s\">" $containerstyle $style $sortTerm)|safeHTML }} {{- $pages := .Page.Pages }} - {{- if .Page.Sections}} - {{- $pages = (.Page.Pages | union .Page.Sections) }} - {{- end }} {{- $defaultOrdersectionsby := .Site.Params.ordersectionsby | default "weight" }} {{- $currentOrdersectionsby := $sortTerm | default (.Page.Params.ordersectionsby | default $defaultOrdersectionsby) }} @@ -87,9 +84,6 @@ {{- end }} {{- $pages := .Page.Pages }} - {{- if .Page.Sections}} - {{- $pages = (.Page.Pages | union .Page.Sections) }} - {{- end }} {{- $defaultOrdersectionsby := .Site.Params.ordersectionsby | default "weight" }} {{- $currentOrdersectionsby := $.sortTerm | default (.Page.Params.ordersectionsby | default $defaultOrdersectionsby) }}