mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-23 15:57:57 +00:00
theme: treat pages without title as hidden #59
This commit is contained in:
parent
e6459c4d5c
commit
d04bbaad4e
3 changed files with 8 additions and 8 deletions
|
@ -13,7 +13,7 @@
|
|||
|
||||
{{ define "menu-nextprev" }}
|
||||
{{$currentNode := .currentnode }}
|
||||
{{ if ne .menu.Params.hidden true}}
|
||||
{{ if and (ne .menu.Params.hidden true) (ne .menu.Title "") }}
|
||||
{{if hasPrefix $currentNode.RelPermalink .menu.RelPermalink }}
|
||||
{{ $currentNode.Scratch.Set "NextPageOK" "OK" }}
|
||||
{{ $currentNode.Scratch.Set "prevPage" ($currentNode.Scratch.Get "prevPageTmp") }}
|
||||
|
|
|
@ -105,7 +105,7 @@
|
|||
{{ $alwaysopen := .alwaysopen }}
|
||||
{{ with $currentNode.File }}{{ $currentFileUniqueID = .UniqueID }}{{ end }}
|
||||
{{with .sect}}
|
||||
{{if and .IsSection (or (not .Params.hidden) $.showhidden)}}
|
||||
{{if and .IsSection (or (and (not .Params.hidden) (ne .Title "")) $.showhidden )}}
|
||||
{{safeHTML .Params.head}}
|
||||
{{ $currentAlwaysopen := .Params.alwaysopen | default $alwaysopen }}
|
||||
<li data-nav-id="{{.RelPermalink}}" title="{{.Title}}" class="dd-item{{if eq .File.UniqueID $currentFileUniqueID}} active{{else if .IsAncestor $currentNode }} parent{{else if $currentAlwaysopen}} parent{{end}}">
|
||||
|
@ -113,7 +113,7 @@
|
|||
{{ partial "menu-pre.html" . }}{{or .Params.menuTitle .LinkTitle .Title}}{{ partial "menu-post.html" . }}
|
||||
{{ if $showvisitedlinks}}<i class="fas fa-check read-icon"></i>{{end}}
|
||||
</a>
|
||||
{{ $numberOfPages := (add (len ( where .Pages "Params.hidden" "ne" true )) (len ( where .Sections "Params.hidden" "ne" true ))) }}
|
||||
{{ $numberOfPages := (add (len (where (where .Pages "Params.hidden" "ne" true ) "Title" "ne" "" )) (len (where (where .Sections "Params.hidden" "ne" true ) "Title" "ne" "" )) ) }}
|
||||
{{ if ne $numberOfPages 0 }}
|
||||
<ul>
|
||||
{{ $currentNode.Scratch.Set "pages" .Pages }}
|
||||
|
@ -124,14 +124,14 @@
|
|||
|
||||
{{if eq .Site.Params.ordersectionsby "title"}}
|
||||
{{ range $pages.ByTitle }}
|
||||
{{ if and .Params.hidden (not $.showhidden) }}
|
||||
{{ if and (or (.Params.hidden) (eq .Title "")) (not $.showhidden) }}
|
||||
{{else}}
|
||||
{{ template "section-tree-nav" dict "sect" . "currentnode" $currentNode "showvisitedlinks" $showvisitedlinks "alwaysopen" true}}
|
||||
{{end}}
|
||||
{{ end }}
|
||||
{{else}}
|
||||
{{ range $pages.ByWeight }}
|
||||
{{ if and .Params.hidden (not $.showhidden) }}
|
||||
{{ if and (or (.Params.hidden) (eq .Title "")) (not $.showhidden) }}
|
||||
{{else}}
|
||||
{{ template "section-tree-nav" dict "sect" . "currentnode" $currentNode "showvisitedlinks" $showvisitedlinks "alwaysopen" true}}
|
||||
{{end}}
|
||||
|
@ -140,7 +140,7 @@
|
|||
</ul>
|
||||
{{ end }}
|
||||
</li>
|
||||
{{else if not .Params.Hidden }}
|
||||
{{else if and (not .Params.hidden) (ne .Title "") }}
|
||||
<li data-nav-id="{{.RelPermalink}}" title="{{.Title}}" class="dd-item{{if eq .File.UniqueID $currentFileUniqueID}} active{{end}}">
|
||||
<a href="{{ .RelPermalink}}">
|
||||
{{ partial "menu-pre.html" . }}{{or .Params.menuTitle .LinkTitle .Title}}{{ partial "menu-post.html" . }}
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
|
||||
{{ define "childs" }}
|
||||
{{ range .menu }}
|
||||
{{ if and .Params.hidden (not $.showhidden) }}
|
||||
{{ if and (or (.Params.hidden) (eq .Title "")) (not $.showhidden) }}
|
||||
{{else}}
|
||||
{{if not .IsHome}}
|
||||
{{if hasPrefix $.style "h"}}
|
||||
|
|
Loading…
Reference in a new issue