mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-23 07:47:54 +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 }}
|
{{- if not $title }}
|
||||||
{{- $title = .Data.Singular }}
|
{{- $title = .Data.Singular }}
|
||||||
{{- end }}
|
{{- 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 }}
|
{{- end }}
|
||||||
{{- $pages = $pages | append (dict
|
{{- $pages = $pages | append (dict
|
||||||
"uri" (partial "relLangPrettyUglyURL.hugo" (dict "to" .))
|
"uri" (partial "relLangPrettyUglyURL.hugo" (dict "to" .))
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
{{- if not $title }}
|
{{- if not $title }}
|
||||||
{{- $title = .Data.Singular }}
|
{{- $title = .Data.Singular }}
|
||||||
{{- end }}
|
{{- 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 }}
|
{{- end }}
|
||||||
{{- $pages = $pages | append (dict
|
{{- $pages = $pages | append (dict
|
||||||
"uri" (partial "relLangPrettyUglyURL.hugo" (dict "to" .))
|
"uri" (partial "relLangPrettyUglyURL.hugo" (dict "to" .))
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
<h1 id="{{ $title | plainify | anchorize }}">{{ $title }}</h1>
|
<h1 id="{{ $title | plainify | anchorize }}">{{ $title }}</h1>
|
||||||
{{- $lastCapital := "" }}
|
{{- $lastCapital := "" }}
|
||||||
{{- range .Data.Terms.Alphabetical }}
|
{{- 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 $capital }}
|
||||||
{{- if ne $lastCapital "" }}
|
{{- if ne $lastCapital "" }}
|
||||||
</ul>
|
</ul>
|
||||||
|
@ -29,7 +29,7 @@
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- if $len }}
|
{{- 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 }}
|
{{- end }}
|
||||||
{{- $lastCapital = $capital }}
|
{{- $lastCapital = $capital }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
{{- if not $title }}
|
{{- if not $title }}
|
||||||
{{- $title = .Data.Singular }}
|
{{- $title = .Data.Singular }}
|
||||||
{{- end }}
|
{{- 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>
|
<h1 id="{{ $title | plainify | anchorize }}">{{ $title }}</h1>
|
||||||
{{- .Content }}
|
{{- .Content }}
|
||||||
<ul class="columnize">
|
<ul class="columnize">
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
{{- $breadcrumb := slice }}
|
{{- $breadcrumb := slice }}
|
||||||
{{- range seq $depth }}
|
{{- range seq $depth }}
|
||||||
{{- if $to }}
|
{{- if $to }}
|
||||||
{{- if $to.Title }}
|
{{- if (default $to.Data.Term $to.Title) }}
|
||||||
{{- $breadcrumb = $breadcrumb | append $to }}
|
{{- $breadcrumb = $breadcrumb | append $to }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- else }}
|
{{- else }}
|
||||||
|
@ -32,17 +32,17 @@
|
||||||
{{- $to := $e }}
|
{{- $to := $e }}
|
||||||
{{- $depth = add $depth 1 }}
|
{{- $depth = add $depth 1 }}
|
||||||
{{- $title := $to.Title }}
|
{{- $title := $to.Title }}
|
||||||
{{- if eq .Kind "taxonomy" }}
|
{{- if eq $to.Kind "taxonomy" }}
|
||||||
{{- $title = i18n $to.Data.Plural }}
|
{{- $title = i18n $to.Data.Plural }}
|
||||||
{{- if not $title }}
|
{{- if not $title }}
|
||||||
{{- $title = $to.Data.Plural }}
|
{{- $title = $to.Data.Plural }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- else if eq .Kind "term" }}
|
{{- else if eq $to.Kind "term" }}
|
||||||
{{- $title = i18n $to.Data.Singular }}
|
{{- $title = i18n $to.Data.Singular }}
|
||||||
{{- if not $title }}
|
{{- if not $title }}
|
||||||
{{- $title = $to.Data.Singular }}
|
{{- $title = $to.Data.Singular }}
|
||||||
{{- end }}
|
{{- 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 }}
|
{{- end }}
|
||||||
{{- if not $title }}
|
{{- if not $title }}
|
||||||
{{- $title = $to.Site.Title }}
|
{{- $title = $to.Site.Title }}
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
{{- if not $title }}
|
{{- if not $title }}
|
||||||
{{- $title = .Data.Singular }}
|
{{- $title = .Data.Singular }}
|
||||||
{{- end }}
|
{{- 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 }}
|
{{- end }}
|
||||||
{{- if and $title .Site.Title (not (eq $title .Site.Title)) }}
|
{{- if and $title .Site.Title (not (eq $title .Site.Title)) }}
|
||||||
{{- $title = printf "%s %s %s" $title (default "::" .Site.Params.titleSeparator) .Site.Title }}
|
{{- $title = printf "%s %s %s" $title (default "::" .Site.Params.titleSeparator) .Site.Title }}
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
{{- if not $title }}
|
{{- if not $title }}
|
||||||
{{- $title = .Data.Singular }}
|
{{- $title = .Data.Singular }}
|
||||||
{{- end }}
|
{{- 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 }}
|
{{- end }}
|
||||||
{{- if and $title .Site.Title (not (eq $title .Site.Title)) }}
|
{{- if and $title .Site.Title (not (eq $title .Site.Title)) }}
|
||||||
{{- $title = printf "%s %s %s" $title (default "::" .Site.Params.titleSeparator) .Site.Title }}
|
{{- $title = printf "%s %s %s" $title (default "::" .Site.Params.titleSeparator) .Site.Title }}
|
||||||
|
@ -64,7 +64,7 @@
|
||||||
{{- if not $title }}
|
{{- if not $title }}
|
||||||
{{- $title = .Data.Singular }}
|
{{- $title = .Data.Singular }}
|
||||||
{{- end }}
|
{{- 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 }}
|
{{- end }}
|
||||||
{{- if and $title .Site.Title (not (eq $title .Site.Title)) }}
|
{{- if and $title .Site.Title (not (eq $title .Site.Title)) }}
|
||||||
{{- $title = printf "%s %s %s" $title (default "::" .Site.Params.titleSeparator) .Site.Title }}
|
{{- $title = printf "%s %s %s" $title (default "::" .Site.Params.titleSeparator) .Site.Title }}
|
||||||
|
|
|
@ -36,7 +36,7 @@
|
||||||
<ul>
|
<ul>
|
||||||
{{- range $term_page := . }}
|
{{- range $term_page := . }}
|
||||||
{{- $to := . }}
|
{{- $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 }}
|
{{- end }}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
{{- if not $title }}
|
{{- if not $title }}
|
||||||
{{- $title = .Data.Singular }}
|
{{- $title = .Data.Singular }}
|
||||||
{{- end }}
|
{{- 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 }}
|
{{- end }}
|
||||||
{{- if and $title .Site.Title (not (eq $title .Site.Title)) }}
|
{{- if and $title .Site.Title (not (eq $title .Site.Title)) }}
|
||||||
{{- $title = printf "%s %s %s" $title (default "::" .Site.Params.titleSeparator) .Site.Title }}
|
{{- $title = printf "%s %s %s" $title (default "::" .Site.Params.titleSeparator) .Site.Title }}
|
||||||
|
|
Loading…
Reference in a new issue