mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-27 01:33:04 +00:00
taxonomy: print term title even if not set in term frontmatter #701
This commit is contained in:
parent
5c71fd84ba
commit
e7ad33ddb6
11 changed files with 21 additions and 14 deletions
4
exampleSite/content/tags/hidden/_index.en.md
Normal file
4
exampleSite/content/tags/hidden/_index.en.md
Normal file
|
@ -0,0 +1,4 @@
|
|||
+++
|
||||
+++
|
||||
|
||||
This lists all pages that are hidden from the home page. This includes pages that define `hidden=true` in their frontmatter as weill as descendents of hidden pages.
|
3
exampleSite/content/tags/hidden/_index.pir.md
Normal file
3
exampleSite/content/tags/hidden/_index.pir.md
Normal file
|
@ -0,0 +1,3 @@
|
|||
+++
|
||||
+++
|
||||
{{< piratify true >}}
|
|
@ -13,7 +13,7 @@
|
|||
{{- if not $title }}
|
||||
{{- $title = .Data.Singular }}
|
||||
{{- end }}
|
||||
{{- $title = printf "%s %s %s" $title (default "::" .Site.Params.titleSeparator) .Title }}
|
||||
{{- $title = printf "%s %s %s" $title (default "::" .Site.Params.titleSeparator) (default .Data.Term .Title) }}
|
||||
{{- end }}
|
||||
{{- $pages = $pages | append (dict
|
||||
"uri" (partial "relLangPrettyUglyURL.hugo" (dict "to" .))
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
{{- if not $title }}
|
||||
{{- $title = .Data.Singular }}
|
||||
{{- end }}
|
||||
{{- $title = printf "%s %s %s" $title (default "::" .Site.Params.titleSeparator) .Title }}
|
||||
{{- $title = printf "%s %s %s" $title (default "::" .Site.Params.titleSeparator) (default .Data.Term .Title) }}
|
||||
{{- end }}
|
||||
{{- $pages = $pages | append (dict
|
||||
"uri" (partial "relLangPrettyUglyURL.hugo" (dict "to" .))
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
<h1 id="{{ $title | plainify | anchorize }}">{{ $title }}</h1>
|
||||
{{- $lastCapital := "" }}
|
||||
{{- range .Data.Terms.Alphabetical }}
|
||||
{{- $capital := substr .Page.Title 0 1 | upper }}
|
||||
{{- $capital := substr (default .Page.Data.Term .Page.Title) 0 1 | upper }}
|
||||
{{- if ne $lastCapital $capital }}
|
||||
{{- if ne $lastCapital "" }}
|
||||
</ul>
|
||||
|
@ -29,7 +29,7 @@
|
|||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if $len }}
|
||||
<li><a href="{{ partial "relLangPrettyUglyURL.hugo" (dict "to" .Page) }}">{{ .Page.Title }}</a> ({{ $len }})</li>
|
||||
<li><a href="{{ partial "relLangPrettyUglyURL.hugo" (dict "to" .Page) }}">{{ (default .Page.Data.Term .Page.Title) }}</a> ({{ $len }})</li>
|
||||
{{- end }}
|
||||
{{- $lastCapital = $capital }}
|
||||
{{- end }}
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
{{- if not $title }}
|
||||
{{- $title = .Data.Singular }}
|
||||
{{- end }}
|
||||
{{- $title = printf "%s %s %s" $title (default "::" .Site.Params.titleSeparator) .Title }}
|
||||
{{- $title = printf "%s %s %s" $title (default "::" .Site.Params.titleSeparator) (default .Data.Term .Title) }}
|
||||
<h1 id="{{ $title | plainify | anchorize }}">{{ $title }}</h1>
|
||||
{{- .Content }}
|
||||
<ul class="columnize">
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
{{- $breadcrumb := slice }}
|
||||
{{- range seq $depth }}
|
||||
{{- if $to }}
|
||||
{{- if $to.Title }}
|
||||
{{- if (default $to.Data.Term $to.Title) }}
|
||||
{{- $breadcrumb = $breadcrumb | append $to }}
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
|
@ -32,17 +32,17 @@
|
|||
{{- $to := $e }}
|
||||
{{- $depth = add $depth 1 }}
|
||||
{{- $title := $to.Title }}
|
||||
{{- if eq .Kind "taxonomy" }}
|
||||
{{- if eq $to.Kind "taxonomy" }}
|
||||
{{- $title = i18n $to.Data.Plural }}
|
||||
{{- if not $title }}
|
||||
{{- $title = $to.Data.Plural }}
|
||||
{{- end }}
|
||||
{{- else if eq .Kind "term" }}
|
||||
{{- else if eq $to.Kind "term" }}
|
||||
{{- $title = i18n $to.Data.Singular }}
|
||||
{{- if not $title }}
|
||||
{{- $title = $to.Data.Singular }}
|
||||
{{- end }}
|
||||
{{- $title = printf "%s %s %s" $title (default "::" .Site.Params.titleSeparator) $to.Title }}
|
||||
{{- $title = printf "%s %s %s" $title (default "::" .Site.Params.titleSeparator) (default $to.Data.Term $to.Title) }}
|
||||
{{- end }}
|
||||
{{- if not $title }}
|
||||
{{- $title = $to.Site.Title }}
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
{{- if not $title }}
|
||||
{{- $title = .Data.Singular }}
|
||||
{{- end }}
|
||||
{{- $title = printf "%s %s %s" .Title (default "::" .Site.Params.titleSeparator) $title }}
|
||||
{{- $title = printf "%s %s %s" (default .Data.Term .Title) (default "::" .Site.Params.titleSeparator) $title }}
|
||||
{{- end }}
|
||||
{{- if and $title .Site.Title (not (eq $title .Site.Title)) }}
|
||||
{{- $title = printf "%s %s %s" $title (default "::" .Site.Params.titleSeparator) .Site.Title }}
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
{{- if not $title }}
|
||||
{{- $title = .Data.Singular }}
|
||||
{{- end }}
|
||||
{{- $title = printf "%s %s %s" .Title (default "::" .Site.Params.titleSeparator) $title }}
|
||||
{{- $title = printf "%s %s %s" (default .Data.Term .Title) (default "::" .Site.Params.titleSeparator) $title }}
|
||||
{{- end }}
|
||||
{{- if and $title .Site.Title (not (eq $title .Site.Title)) }}
|
||||
{{- $title = printf "%s %s %s" $title (default "::" .Site.Params.titleSeparator) .Site.Title }}
|
||||
|
@ -64,7 +64,7 @@
|
|||
{{- if not $title }}
|
||||
{{- $title = .Data.Singular }}
|
||||
{{- end }}
|
||||
{{- $title = printf "%s %s %s" .Title (default "::" .Site.Params.titleSeparator) $title }}
|
||||
{{- $title = printf "%s %s %s" (default .Data.Term .Title) (default "::" .Site.Params.titleSeparator) $title }}
|
||||
{{- end }}
|
||||
{{- if and $title .Site.Title (not (eq $title .Site.Title)) }}
|
||||
{{- $title = printf "%s %s %s" $title (default "::" .Site.Params.titleSeparator) .Site.Title }}
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
<ul>
|
||||
{{- range $term_page := . }}
|
||||
{{- $to := . }}
|
||||
<li><a class="term-link" href="{{ partial "relLangPrettyUglyURL.hugo" (dict "to" $to) }}">{{ $to.Title }}</a></li>
|
||||
<li><a class="term-link" href="{{ partial "relLangPrettyUglyURL.hugo" (dict "to" $to) }}">{{ default $to.Data.Term $to.Title }}</a></li>
|
||||
{{- end }}
|
||||
</ul>
|
||||
</div>
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
{{- if not $title }}
|
||||
{{- $title = .Data.Singular }}
|
||||
{{- end }}
|
||||
{{- $title = printf "%s %s %s" .Title (default "::" .Site.Params.titleSeparator) $title }}
|
||||
{{- $title = printf "%s %s %s" (default .Data.Term .Title) (default "::" .Site.Params.titleSeparator) $title }}
|
||||
{{- end }}
|
||||
{{- if and $title .Site.Title (not (eq $title .Site.Title)) }}
|
||||
{{- $title = printf "%s %s %s" $title (default "::" .Site.Params.titleSeparator) .Site.Title }}
|
||||
|
|
Loading…
Reference in a new issue