mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-27 01:33:04 +00:00
theme: allow pages on top level #434
This commit is contained in:
parent
fe2d96f386
commit
0c10cc8af3
5 changed files with 12 additions and 21 deletions
|
@ -1,8 +1,6 @@
|
|||
{{- partialCached "page-meta.hugo" . .RelPermalink }}
|
||||
{{- $pages := .Page.Pages }}
|
||||
{{- if .Page.IsHome }}
|
||||
{{- $pages = .Page.Sections }}
|
||||
{{- else if .Page.Sections}}
|
||||
{{- if .Page.Sections}}
|
||||
{{- $pages = (.Page.Pages | union .Page.Sections) }}
|
||||
{{- end }}
|
||||
{{- $limit := .Site.Config.Services.RSS.Limit -}}
|
||||
|
|
|
@ -29,11 +29,11 @@
|
|||
{{- $currentOrdersectionsby := .Site.Home.Params.ordersectionsby | default $defaultOrdersectionsby }}
|
||||
{{- $defaultAlwaysopen := .Site.Params.alwaysopen | default false }}
|
||||
{{- if eq $currentOrdersectionsby "title" }}
|
||||
{{- range .Site.Home.Sections.ByTitle }}
|
||||
{{- range .Site.Home.Pages.ByTitle }}
|
||||
{{- template "section-tree-nav" dict "sect" . "currentnode" $currentNode "showvisitedlinks" $showvisitedlinks "alwaysopen" $defaultAlwaysopen }}
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
{{- range .Site.Home.Sections.ByWeight }}
|
||||
{{- range .Site.Home.Pages.ByWeight }}
|
||||
{{- template "section-tree-nav" dict "sect" . "currentnode" $currentNode "showvisitedlinks" $showvisitedlinks "alwaysopen" $defaultAlwaysopen }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
@ -134,9 +134,7 @@
|
|||
{{- $isAncestor := and (not $isSelf) (.IsAncestor $currentNode) }}
|
||||
{{- $isActive := $isSelf }}
|
||||
{{- $pages := .Pages }}
|
||||
{{- if .Page.IsHome }}
|
||||
{{- $pages = .Sections }}
|
||||
{{- else if .Page.Sections}}
|
||||
{{- if .Sections}}
|
||||
{{- $pages = (.Pages | union .Sections) }}
|
||||
{{- end }}
|
||||
{{- $relearnIsHiddenFrom := index ($currentNode.Scratch.Get "relearnIsHiddenFrom") .RelPermalink }}
|
||||
|
|
|
@ -14,7 +14,10 @@
|
|||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- $pages := .Site.Home.Sections }}
|
||||
{{- $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 }}
|
||||
|
@ -53,9 +56,7 @@
|
|||
{{- $isAncestor := and (not $isSelf) (.IsAncestor $currentNode) }}
|
||||
{{- $isActive = or $isSelf $isActive }}
|
||||
{{- $pages := .Pages }}
|
||||
{{- if .Page.IsHome }}
|
||||
{{- $pages = .Sections }}
|
||||
{{- else if .Page.Sections}}
|
||||
{{- if .Sections}}
|
||||
{{- $pages = (.Pages | union .Sections) }}
|
||||
{{- end }}
|
||||
{{- $relearnIsHiddenFrom := index ($currentNode.Scratch.Get "relearnIsHiddenFrom") .RelPermalink }}
|
||||
|
|
|
@ -52,9 +52,7 @@
|
|||
{{- end }}
|
||||
|
||||
{{- $pages := .node.Pages }}
|
||||
{{- if .node.IsHome }}
|
||||
{{- $pages = .node.Sections }}
|
||||
{{- else if .node.Sections }}
|
||||
{{- if .node.Sections }}
|
||||
{{- $pages = (.node.Pages | union .node.Sections) }}
|
||||
{{- end }}
|
||||
{{- $defaultOrdersectionsby := .defaultOrdersectionsby }}
|
||||
|
|
|
@ -18,9 +18,7 @@
|
|||
{{- with $context }}
|
||||
{{ (printf "<%s class=\"children children-%s children-sort-%s\">" $containerstyle $style $sortTerm)|safeHTML }}
|
||||
{{- $pages := .Page.Pages }}
|
||||
{{- if .Page.IsHome }}
|
||||
{{- $pages = .Page.Sections }}
|
||||
{{- else if .Page.Sections}}
|
||||
{{- if .Page.Sections}}
|
||||
{{- $pages = (.Page.Pages | union .Page.Sections) }}
|
||||
{{- end }}
|
||||
|
||||
|
@ -89,9 +87,7 @@
|
|||
{{- end }}
|
||||
|
||||
{{- $pages := .Page.Pages }}
|
||||
{{- if .Page.IsHome }}
|
||||
{{- $pages = .Page.Sections }}
|
||||
{{- else if .Page.Sections}}
|
||||
{{- if .Page.Sections}}
|
||||
{{- $pages = (.Page.Pages | union .Page.Sections) }}
|
||||
{{- end }}
|
||||
|
||||
|
|
Loading…
Reference in a new issue