mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-27 01:33:04 +00:00
tags: don't count tags if page is hidden #310
This commit is contained in:
parent
3abd1225e5
commit
000b399e0c
2 changed files with 12 additions and 4 deletions
|
@ -5,8 +5,14 @@
|
|||
<h1>{{ if eq .Kind "term" }}{{ .Data.Singular | humanize }} {{ default "::" .Site.Params.titleSeparator }} {{ end }}{{ .Title }}</h1>
|
||||
<ul>
|
||||
{{- range .Data.Terms.Alphabetical }}
|
||||
{{- if and .Page.Title (or (ne (.Page.Scratch.Get "relearnIsHiddenStem") true) (ne .Page.Site.Params.disableTagHiddenPages true) ) }}
|
||||
<li><a href="{{ .Page.RelPermalink }}">{{ .Page.Title }}</a> ({{ len .Pages }})</li>
|
||||
{{- $len := 0 }}
|
||||
{{- range .Pages }}
|
||||
{{- if and .Title (or (ne (.Scratch.Get "relearnIsHiddenStem") true) (ne .Site.Params.disableTagHiddenPages true) ) }}
|
||||
{{- $len = add $len 1 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if $len }}
|
||||
<li><a href="{{ .Page.RelPermalink }}">{{ .Page.Title }}</a> ({{ $len }})</li>
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
{{- range sort .Pages "Title" }}
|
||||
|
|
|
@ -38,8 +38,10 @@
|
|||
{{- $hidden_stem:= or $hidden_node .hiddenstem }}
|
||||
{{- $hidden_current_stem:= or $hidden_node .hiddencurrent }}
|
||||
{{- $hidden_from_current := or (and $hidden_node (not $isAncestor) (not $isSelf) ) (and .hiddencurrent (or $isPreSelf $isPostSelf $isDescendant) ) }}
|
||||
{{- $currentNode.Scratch.SetInMap "relearnIsHiddenNode" .node.RelPermalink $hidden_node }}
|
||||
{{- $currentNode.Scratch.SetInMap "relearnIsHiddenStem" .node.RelPermalink $hidden_stem }}
|
||||
{{- if $isSelf }}
|
||||
{{- $currentNode.Scratch.Set "relearnIsHiddenNode" $hidden_node }}
|
||||
{{- $currentNode.Scratch.Set "relearnIsHiddenStem" $hidden_stem }}
|
||||
{{- end}}
|
||||
{{- $currentNode.Scratch.SetInMap "relearnIsHiddenFrom" .node.RelPermalink $hidden_current_stem }}
|
||||
|
||||
{{- if not $hidden_from_current }}
|
||||
|
|
Loading…
Reference in a new issue