mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-23 07:47:54 +00:00
theme: simplify pagesBy #685
This commit is contained in:
parent
1b2e139512
commit
fe9d605d57
5 changed files with 7 additions and 17 deletions
|
@ -31,7 +31,7 @@
|
|||
<div id="R-content-wrapper" class="highlightable">
|
||||
<div id="R-topics">
|
||||
<ul class="enlarge morespace collapsible-menu">
|
||||
{{- $pages := partial "pageHelper/pagesBy.html" (dict "page" .Site.Home "hidden" true) }}
|
||||
{{- $pages := partial "pageHelper/pagesBy.html" (dict "page" .Site.Home) }}
|
||||
{{- $defaultAlwaysopen := .Site.Params.alwaysopen | default false }}
|
||||
{{- range $pages }}
|
||||
{{- template "section-tree-nav" dict "sect" . "currentnode" $currentNode "showvisitedlinks" $showvisitedlinks "alwaysopen" $defaultAlwaysopen }}
|
||||
|
@ -130,7 +130,7 @@
|
|||
{{- $isSelf := eq .RelPermalink $currentFileRelPermalink }}
|
||||
{{- $isAncestor := and (not $isSelf) (.IsAncestor $currentNode) }}
|
||||
{{- $isActive := $isSelf }}
|
||||
{{- $pages := partial "pageHelper/pagesBy.html" (dict "page" . "hidden" true) }}
|
||||
{{- $pages := partial "pageHelper/pagesBy.html" (dict "page" .) }}
|
||||
{{- $relearnIsHiddenFrom := index ($currentNode.Scratch.Get "relearnIsHiddenFrom") .RelPermalink }}
|
||||
{{- $hidden := and $relearnIsHiddenFrom (not $.showhidden) (not $isSelf) (not $isAncestor) }}
|
||||
{{- if $hidden }}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
{{- $page.Page.Store.Set (printf "%sIsNested" $outputFormat) true }}
|
||||
{{- with $page }}
|
||||
{{- $currentNode := . }}
|
||||
{{- $pages := partial "pageHelper/pagesBy.html" (dict "page" . "hidden" true) }}
|
||||
{{- $pages := partial "pageHelper/pagesBy.html" (dict "page" .) }}
|
||||
{{- template "section-print" dict "sect" . "currentnode" $currentNode "outputFormat" $outputFormat }}
|
||||
{{- if $pages }}
|
||||
<section>
|
||||
|
@ -23,7 +23,7 @@
|
|||
{{- with .sect }}
|
||||
{{- $isSelf := eq .RelPermalink $currentFileRelPermalink }}
|
||||
{{- $isAncestor := and (not $isSelf) (.IsAncestor $currentNode) }}
|
||||
{{- $pages := partial "pageHelper/pagesBy.html" (dict "page" . "hidden" true) }}
|
||||
{{- $pages := partial "pageHelper/pagesBy.html" (dict "page" .) }}
|
||||
{{- $relearnIsHiddenFrom := index ($currentNode.Scratch.Get "relearnIsHiddenFrom") .RelPermalink }}
|
||||
{{- $hidden := and $relearnIsHiddenFrom (not $.showhidden) (not $isSelf) (not $isAncestor) }}
|
||||
{{- if $hidden }}
|
||||
|
|
|
@ -50,7 +50,7 @@
|
|||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{- $pages := partial "pageHelper/pagesBy.html" (dict "page" .node "hidden" true) }}
|
||||
{{- $pages := partial "pageHelper/pagesBy.html" (dict "page" .node) }}
|
||||
{{- range $pages }}
|
||||
{{- template "relearn-structure" dict "node" . "currentnode" $currentNode "hiddenstem" $hidden_stem "hiddencurrent" $hidden_from_current }}
|
||||
{{- end }}
|
||||
|
|
|
@ -32,14 +32,4 @@
|
|||
{{- $pages = $page.Pages }}
|
||||
{{- end }}
|
||||
|
||||
{{- if not $hidden }}
|
||||
{{- $nonhiddenpages := slice }}
|
||||
{{- range $page := $pages }}
|
||||
{{- if not (partial "pageHelper/isHidden.html" $page) }}
|
||||
{{- $nonhiddenpages := $nonhiddenpages | append $page }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- $pages = $nonhiddenpages }}
|
||||
{{- end }}
|
||||
|
||||
{{- return $pages }}
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
{{- with $page }}
|
||||
{{ (printf "<%s class=\"children children-%s children-sort-%s\">" $containerstyle $style $sortTerm)|safeHTML }}
|
||||
{{- $pages := partial "pageHelper/pagesBy.html" (dict "page" . "hidden" true) }}
|
||||
{{- $pages := partial "pageHelper/pagesBy.html" (dict "page" .) }}
|
||||
{{- template "childs" dict "menu" $pages "containerstyle" $containerstyle "style" $style "showhidden" $showhidden "count" 1 "depth" $depth "pages" .Site.Pages "description" $withDescription "sortTerm" $sortTerm "page" . }}
|
||||
{{ (printf "</%s>" $containerstyle)|safeHTML }}
|
||||
{{- end }}
|
||||
|
@ -66,7 +66,7 @@
|
|||
{{- (printf "<%s>" $.containerstyle)|safeHTML }}
|
||||
{{- end }}
|
||||
|
||||
{{- $pages := partial "pageHelper/pagesBy.html" (dict "page" . "hidden" true) }}
|
||||
{{- $pages := partial "pageHelper/pagesBy.html" (dict "page" .) }}
|
||||
{{- template "childs" dict "menu" $pages "containerstyle" $.containerstyle "style" $.style "showhidden" $.showhidden "count" (add $.count 1) "depth" $.depth "pages" $.pages "description" $.description "sortTerm" $.sortTerm "page" $page }}
|
||||
|
||||
{{- if eq $.style "li" }}
|
||||
|
|
Loading…
Reference in a new issue