Use link title where possible

master
Will Faught 5 months ago
parent ccadbf724d
commit dcbc7775ea

@ -6,9 +6,9 @@
{{ with $page.Pages }} {{ with $page.Pages }}
<div id="paige-subpages"> <div id="paige-subpages">
<ul class="list-inline text-center"> <ul class="list-inline text-center">
{{ range (sort . "Title") }} {{ range (sort . "LinkTitle") }}
<li class="list-inline-item"> <li class="list-inline-item">
<a href="{{ .RelPermalink }}">{{ .Title | markdownify | plainify | htmlUnescape }}</a> <a href="{{ .RelPermalink }}">{{ .LinkTitle | markdownify | plainify | htmlUnescape }}</a>
</li> </li>
{{ end }} {{ end }}
</ul> </ul>

@ -16,7 +16,7 @@
{{ $summary := $page.Summary | markdownify | plainify | htmlUnescape | and ($page.Parent.Param "paige.subpage.disable_summary" | not) }} {{ $summary := $page.Summary | markdownify | plainify | htmlUnescape | and ($page.Parent.Param "paige.subpage.disable_summary" | not) }}
{{ $tags := $page.GetTerms "tags" }} {{ $tags := $page.GetTerms "tags" }}
{{ $time := $page.ReadingTime | and ($page.Parent.Param "paige.subpage.disable_reading_time" | not) }} {{ $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 }} {{ if $draft }}
{{ $flags = $flags | append "paige-draft" "paige-unpublished" }} {{ $flags = $flags | append "paige-draft" "paige-unpublished" }}
@ -39,7 +39,7 @@
{{ end }} {{ end }}
{{ $class := delimit (slice "paige-page" "w-100" | append $flags | uniq | sort) " " }} {{ $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 }}"> <div class="{{ $class }}">
{{ with $title }} {{ with $title }}
@ -68,11 +68,11 @@
{{- if $normal -}} {{- if $normal -}}
{{- if gt $i 0 }} · {{ end -}} {{- 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 -}} {{- else -}}
{{- if gt $i 0 }} {{ end -}} {{- 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 -}}
{{- end }} {{- end }}
</p> </p>
@ -83,7 +83,7 @@
{{ range $i, $series := . -}} {{ range $i, $series := . -}}
{{- if gt $i 0 }} · {{ end -}} {{- if gt $i 0 }} · {{ end -}}
<a class="link-secondary" href="{{ .RelPermalink }}">{{ .Title }}</a> <a class="link-secondary" href="{{ .RelPermalink }}">{{ .LinkTitle }}</a>
{{- end }} {{- end }}
</p> </p>
{{ end }} {{ end }}
@ -93,7 +93,7 @@
{{ range $i, $author := . -}} {{ range $i, $author := . -}}
{{- if gt $i 0 }} · {{ end -}} {{- if gt $i 0 }} · {{ end -}}
<a class="link-secondary" href="{{ .RelPermalink }}">{{ .Title }}</a> <a class="link-secondary" href="{{ .RelPermalink }}">{{ .LinkTitle }}</a>
{{- end }} {{- end }}
</p> </p>
{{ end }} {{ end }}

@ -42,11 +42,11 @@
{{ if or $next $prev }} {{ if or $next $prev }}
<div id="paige-siblings"> <div id="paige-siblings">
{{ with $prev }} {{ with $prev }}
<div class="paige-row-narrow text-center text-secondary" id="paige-next"><a class="link-secondary" href="{{ .Permalink }}">{{ .Title }}</a> &rsaquo;</div> <div class="paige-row-narrow text-center text-secondary" id="paige-next"><a class="link-secondary" href="{{ .Permalink }}">{{ .LinkTitle }}</a> &rsaquo;</div>
{{ end }} {{ end }}
{{ with $next }} {{ with $next }}
<div class="paige-row-narrow text-center text-secondary" id="paige-prev">&lsaquo; <a class="link-secondary" href="{{ .Permalink }}">{{ .Title }}</a></div> <div class="paige-row-narrow text-center text-secondary" id="paige-prev">&lsaquo; <a class="link-secondary" href="{{ .Permalink }}">{{ .LinkTitle }}</a></div>
{{ end }} {{ end }}
</div> </div>
{{ end }} {{ end }}

@ -14,10 +14,10 @@
{{ $series := $page.GetTerms "series" | and ($page.Param "paige.page.disable_series" | not) }} {{ $series := $page.GetTerms "series" | and ($page.Param "paige.page.disable_series" | not) }}
{{ $tags := $page.GetTerms "tags" }} {{ $tags := $page.GetTerms "tags" }}
{{ $time := $page.ReadingTime | and ($page.Param "paige.page.disable_reading_time" | not) }} {{ $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) }} {{ $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 }} {{ if or $alert $authors $date $description $first $keywords $last $time $series $title $toc }}
<header class="mw-100" id="paige-page-header"> <header class="mw-100" id="paige-page-header">
@ -50,11 +50,11 @@
{{- if $normal -}} {{- if $normal -}}
{{- if gt $i 0 }} · {{ end -}} {{- 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 -}} {{- else -}}
{{- if gt $i 0 }} {{ end -}} {{- 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 -}}
{{- end }} {{- end }}
</p> </p>
@ -65,7 +65,7 @@
{{ range $i, $series := . -}} {{ range $i, $series := . -}}
{{- if gt $i 0 }} · {{ end -}} {{- 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 }} {{- end }}
</p> </p>
{{ end }} {{ end }}
@ -75,7 +75,7 @@
{{ range $i, $author := . -}} {{ range $i, $author := . -}}
{{- if gt $i 0 }} · {{ end -}} {{- 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 }} {{- end }}
</p> </p>
{{ end }} {{ end }}

@ -108,7 +108,7 @@
{{ end }} {{ end }}
{{ end }} {{ end }}
{{ $pages = sort $pages "Title" }} {{ $pages = sort $pages "LinkTitle" }}
<nav aria-label="{{ i18n `paige_menu` }}" class="paige-row-wide" id="paige-menu"> <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 }}"> <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 }} {{ $active := or $home $menu $section }}
<li class="nav-item"> <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> </li>
{{ end }} {{ end }}
</ul> </ul>
@ -147,7 +147,7 @@
{{ $last := sub (len $reverse) 1 }} {{ $last := sub (len $reverse) 1 }}
{{ range $i, $ancestor := $reverse }} {{ range $i, $ancestor := $reverse }}
{{ $title := $ancestor.Title }} {{ $title := $ancestor.LinkTitle }}
{{ if and (eq $i $last) (not $title) }} {{ if and (eq $i $last) (not $title) }}
{{ $title = $page.Param "paige.title" | default (site.Title) }} {{ $title = $page.Param "paige.title" | default (site.Title) }}

Loading…
Cancel
Save