mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-27 01:33:04 +00:00
theme: better HTML titles and breadcrumbs for search and tag pages #521
This commit is contained in:
parent
b11969b3d0
commit
98c88d8e2e
1 changed files with 16 additions and 5 deletions
|
@ -10,11 +10,15 @@
|
||||||
{{- partial "meta.html" . }}
|
{{- partial "meta.html" . }}
|
||||||
{{- $page := . }}
|
{{- $page := . }}
|
||||||
{{- $link := "<link href=\"%s\" rel=\"%s\" type=\"%s\" title=\"%s\">" }}
|
{{- $link := "<link href=\"%s\" rel=\"%s\" type=\"%s\" title=\"%s\">" }}
|
||||||
{{- $title := "" }}
|
{{- $title := .Title }}
|
||||||
{{- if and .Title (not (eq .Title .Site.Title)) }}
|
{{- if eq $outputFormat "searchpage" }}
|
||||||
{{- $title = printf "%s %s " .Title (default "::" .Site.Params.titleSeparator) }}
|
{{- $title = T "Search" }}
|
||||||
|
{{- else if eq .Kind "term" }}
|
||||||
|
{{- $title = printf "%s %s" (.Data.Singular | humanize) $title }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if and $title (not (eq $title .Site.Title)) }}
|
||||||
|
{{- $title = printf "%s %s %s" $title (default "::" .Site.Params.titleSeparator) .Site.Title }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- $title = printf "%s%s" $title .Site.Title }}
|
|
||||||
<title>{{ $title }}</title>
|
<title>{{ $title }}</title>
|
||||||
|
|
||||||
{{- if .IsTranslated -}}
|
{{- if .IsTranslated -}}
|
||||||
|
@ -173,7 +177,14 @@
|
||||||
{{- $remaining = sub $remaining 1 }}
|
{{- $remaining = sub $remaining 1 }}
|
||||||
{{- if $ispublished }}
|
{{- if $ispublished }}
|
||||||
{{- $depth = add $depth 1 }}
|
{{- $depth = add $depth 1 }}
|
||||||
<li itemscope itemtype="https://schema.org/ListItem" itemprop="itemListElement">{{ if $remaining }}<a itemprop="item" href="{{ partial "relLangPrettyUglyURL.hugo" (dict "to" $to) }}">{{end}}<span itemprop="name">{{ if $to.Title }}{{ $to.Title }}{{ else }}{{ $to.Site.Title }}{{ end }}</span>{{ if $remaining }}</a>{{ end }}<meta itemprop="position" content="{{ $depth }}">{{ if $remaining }} > {{ end }}</li>
|
{{- $title := $to.Title }}
|
||||||
|
{{- if eq .Kind "term" }}
|
||||||
|
{{- $title = printf "%s %s" (.Data.Singular | humanize) $title }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if not $title }}
|
||||||
|
{{- $title = $to.Site.Title }}
|
||||||
|
{{- end }}
|
||||||
|
<li itemscope itemtype="https://schema.org/ListItem" itemprop="itemListElement">{{ if $remaining }}<a itemprop="item" href="{{ partial "relLangPrettyUglyURL.hugo" (dict "to" $to) }}">{{end}}<span itemprop="name">{{ $title }}</span>{{ if $remaining }}</a>{{ end }}<meta itemprop="position" content="{{ $depth }}">{{ if $remaining }} > {{ end }}</li>
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
Loading…
Reference in a new issue