Use link title where possible
This commit is contained in:
@@ -6,9 +6,9 @@
|
||||
{{ with $page.Pages }}
|
||||
<div id="paige-subpages">
|
||||
<ul class="list-inline text-center">
|
||||
{{ range (sort . "Title") }}
|
||||
{{ range (sort . "LinkTitle") }}
|
||||
<li class="list-inline-item">
|
||||
<a href="{{ .RelPermalink }}">{{ .Title | markdownify | plainify | htmlUnescape }}</a>
|
||||
<a href="{{ .RelPermalink }}">{{ .LinkTitle | markdownify | plainify | htmlUnescape }}</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
|
@@ -16,7 +16,7 @@
|
||||
{{ $summary := $page.Summary | markdownify | plainify | htmlUnescape | and ($page.Parent.Param "paige.subpage.disable_summary" | not) }}
|
||||
{{ $tags := $page.GetTerms "tags" }}
|
||||
{{ $time := $page.ReadingTime | and ($page.Parent.Param "paige.subpage.disable_reading_time" | not) }}
|
||||
{{ $title := $page.Title | markdownify | plainify | htmlUnescape | and ($page.Parent.Param "paige.subpage.disable_title" | not) }}
|
||||
{{ $title := $page.LinkTitle | markdownify | plainify | htmlUnescape | and ($page.Parent.Param "paige.subpage.disable_title" | not) }}
|
||||
|
||||
{{ if $draft }}
|
||||
{{ $flags = $flags | append "paige-draft" "paige-unpublished" }}
|
||||
@@ -39,7 +39,7 @@
|
||||
{{ end }}
|
||||
|
||||
{{ $class := delimit (slice "paige-page" "w-100" | append $flags | uniq | sort) " " }}
|
||||
{{ $keywords := sort (append $categories $tags) "Title" | and ($page.Parent.Param "paige.subpage.disable_keywords" | not) }}
|
||||
{{ $keywords := sort (append $categories $tags) "LinkTitle" | and ($page.Parent.Param "paige.subpage.disable_keywords" | not) }}
|
||||
|
||||
<div class="{{ $class }}">
|
||||
{{ with $title }}
|
||||
@@ -68,11 +68,11 @@
|
||||
{{- if $normal -}}
|
||||
{{- if gt $i 0 }} · {{ end -}}
|
||||
|
||||
<a class="link-secondary paige-keyword paige-keyword-{{ $kind }}" href="{{ .RelPermalink | safeURL }}">{{ .Title }}</a>
|
||||
<a class="link-secondary paige-keyword paige-keyword-{{ $kind }}" href="{{ .RelPermalink | safeURL }}">{{ .LinkTitle }}</a>
|
||||
{{- else -}}
|
||||
{{- if gt $i 0 }} {{ end -}}
|
||||
|
||||
<a class="badge paige-keyword paige-keyword-{{ $kind }} text-bg-secondary text-decoration-none" href="{{ .RelPermalink | safeURL }}">{{ .Title }}</a>
|
||||
<a class="badge paige-keyword paige-keyword-{{ $kind }} text-bg-secondary text-decoration-none" href="{{ .RelPermalink | safeURL }}">{{ .LinkTitle }}</a>
|
||||
{{- end -}}
|
||||
{{- end }}
|
||||
</p>
|
||||
@@ -83,7 +83,7 @@
|
||||
{{ range $i, $series := . -}}
|
||||
{{- if gt $i 0 }} · {{ end -}}
|
||||
|
||||
<a class="link-secondary" href="{{ .RelPermalink }}">{{ .Title }}</a>
|
||||
<a class="link-secondary" href="{{ .RelPermalink }}">{{ .LinkTitle }}</a>
|
||||
{{- end }}
|
||||
</p>
|
||||
{{ end }}
|
||||
@@ -93,7 +93,7 @@
|
||||
{{ range $i, $author := . -}}
|
||||
{{- if gt $i 0 }} · {{ end -}}
|
||||
|
||||
<a class="link-secondary" href="{{ .RelPermalink }}">{{ .Title }}</a>
|
||||
<a class="link-secondary" href="{{ .RelPermalink }}">{{ .LinkTitle }}</a>
|
||||
{{- end }}
|
||||
</p>
|
||||
{{ end }}
|
||||
|
@@ -42,11 +42,11 @@
|
||||
{{ if or $next $prev }}
|
||||
<div id="paige-siblings">
|
||||
{{ with $prev }}
|
||||
<div class="paige-row-narrow text-center text-secondary" id="paige-next"><a class="link-secondary" href="{{ .Permalink }}">{{ .Title }}</a> ›</div>
|
||||
<div class="paige-row-narrow text-center text-secondary" id="paige-next"><a class="link-secondary" href="{{ .Permalink }}">{{ .LinkTitle }}</a> ›</div>
|
||||
{{ end }}
|
||||
|
||||
{{ with $next }}
|
||||
<div class="paige-row-narrow text-center text-secondary" id="paige-prev">‹ <a class="link-secondary" href="{{ .Permalink }}">{{ .Title }}</a></div>
|
||||
<div class="paige-row-narrow text-center text-secondary" id="paige-prev">‹ <a class="link-secondary" href="{{ .Permalink }}">{{ .LinkTitle }}</a></div>
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ end }}
|
||||
|
@@ -14,10 +14,10 @@
|
||||
{{ $series := $page.GetTerms "series" | and ($page.Param "paige.page.disable_series" | not) }}
|
||||
{{ $tags := $page.GetTerms "tags" }}
|
||||
{{ $time := $page.ReadingTime | and ($page.Param "paige.page.disable_reading_time" | not) }}
|
||||
{{ $title := $page.Title | markdownify | and ($page.Param "paige.page.disable_title" | not) }}
|
||||
{{ $title := $page.LinkTitle | markdownify | and ($page.Param "paige.page.disable_title" | not) }}
|
||||
{{ $toc := and $page.Content (ne $page.TableOfContents `<nav id="TableOfContents"></nav>`) | and ($page.Param "paige.page.disable_toc" | not) }}
|
||||
|
||||
{{ $keywords := sort (append $categories $tags) "Title" | and ($page.Param "paige.page.disable_keywords" | not) }}
|
||||
{{ $keywords := sort (append $categories $tags) "LinkTitle" | and ($page.Param "paige.page.disable_keywords" | not) }}
|
||||
|
||||
{{ if or $alert $authors $date $description $first $keywords $last $time $series $title $toc }}
|
||||
<header class="mw-100" id="paige-page-header">
|
||||
@@ -50,11 +50,11 @@
|
||||
{{- if $normal -}}
|
||||
{{- if gt $i 0 }} · {{ end -}}
|
||||
|
||||
<a class="link-secondary paige-keyword paige-keyword-{{ $kind }}" href="{{ .RelPermalink | safeURL }}" {{ if $microdata }} itemprop="keywords" {{ end }}>{{ .Title }}</a>
|
||||
<a class="link-secondary paige-keyword paige-keyword-{{ $kind }}" href="{{ .RelPermalink | safeURL }}" {{ if $microdata }} itemprop="keywords" {{ end }}>{{ .LinkTitle }}</a>
|
||||
{{- else -}}
|
||||
{{- if gt $i 0 }} {{ end -}}
|
||||
|
||||
<a class="badge paige-keyword paige-keyword-{{ $kind }} text-bg-secondary text-decoration-none" href="{{ .RelPermalink | safeURL }}" {{ if $microdata }} itemprop="keywords" {{ end }}>{{ .Title }}</a>
|
||||
<a class="badge paige-keyword paige-keyword-{{ $kind }} text-bg-secondary text-decoration-none" href="{{ .RelPermalink | safeURL }}" {{ if $microdata }} itemprop="keywords" {{ end }}>{{ .LinkTitle }}</a>
|
||||
{{- end -}}
|
||||
{{- end }}
|
||||
</p>
|
||||
@@ -65,7 +65,7 @@
|
||||
{{ range $i, $series := . -}}
|
||||
{{- if gt $i 0 }} · {{ end -}}
|
||||
|
||||
<a class="link-secondary" href="{{ .RelPermalink }}" {{ if $microdata }} itemprop="isPartOf" {{ end }}>{{ .Title }}</a>
|
||||
<a class="link-secondary" href="{{ .RelPermalink }}" {{ if $microdata }} itemprop="isPartOf" {{ end }}>{{ .LinkTitle }}</a>
|
||||
{{- end }}
|
||||
</p>
|
||||
{{ end }}
|
||||
@@ -75,7 +75,7 @@
|
||||
{{ range $i, $author := . -}}
|
||||
{{- if gt $i 0 }} · {{ end -}}
|
||||
|
||||
<a class="link-secondary" href="{{ .RelPermalink }}" {{ if $microdata }} itemprop="author" {{ end }}>{{ .Title }}</a>
|
||||
<a class="link-secondary" href="{{ .RelPermalink }}" {{ if $microdata }} itemprop="author" {{ end }}>{{ .LinkTitle }}</a>
|
||||
{{- end }}
|
||||
</p>
|
||||
{{ end }}
|
||||
|
@@ -108,7 +108,7 @@
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ $pages = sort $pages "Title" }}
|
||||
{{ $pages = sort $pages "LinkTitle" }}
|
||||
|
||||
<nav aria-label="{{ i18n `paige_menu` }}" class="paige-row-wide" id="paige-menu">
|
||||
<ul class="align-items-center justify-content-center nav {{ if $pills }} nav-pills {{ else if $tabs }} nav-tabs {{ else if $underline }} nav-underline {{ end }}">
|
||||
@@ -130,7 +130,7 @@
|
||||
{{ $active := or $home $menu $section }}
|
||||
|
||||
<li class="nav-item">
|
||||
<a {{ if $active }} aria-current="page" {{ end }} class="{{ if $active }} active {{ if $links }} fw-bold text-body {{ end }} {{ end }} nav-link {{ if $links }} text-decoration-underline {{ end }}" href="{{ .RelPermalink | safeURL }}" {{ with partial "paige/func-target.html" (dict "page" $page "url" .RelPermalink) }} target="{{ . }}" {{ end }}>{{ .Title }}</a>
|
||||
<a {{ if $active }} aria-current="page" {{ end }} class="{{ if $active }} active {{ if $links }} fw-bold text-body {{ end }} {{ end }} nav-link {{ if $links }} text-decoration-underline {{ end }}" href="{{ .RelPermalink | safeURL }}" {{ with partial "paige/func-target.html" (dict "page" $page "url" .RelPermalink) }} target="{{ . }}" {{ end }}>{{ .LinkTitle }}</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
@@ -147,7 +147,7 @@
|
||||
{{ $last := sub (len $reverse) 1 }}
|
||||
|
||||
{{ range $i, $ancestor := $reverse }}
|
||||
{{ $title := $ancestor.Title }}
|
||||
{{ $title := $ancestor.LinkTitle }}
|
||||
|
||||
{{ if and (eq $i $last) (not $title) }}
|
||||
{{ $title = $page.Param "paige.title" | default (site.Title) }}
|
||||
|
Reference in New Issue
Block a user