breadcrumb: use .LinkTitle instead of .Title if available #816

This commit is contained in:
Sören Weber 2024-03-24 00:59:55 +01:00
parent 93578d810d
commit b88ccc2304
No known key found for this signature in database
GPG key ID: BEC6D55545451B6D
4 changed files with 9 additions and 1 deletions

View file

@ -18,6 +18,12 @@ This document shows you what's new in the latest release and flags it with one o
---
## 5.27.0.beta (XXXX-XX-XX) {#5270}
- {{% badge style="info" icon="plus-circle" title=" " %}}New{{% /badge %}} The breadcrumbs used in the topbar, search results and the taxonomy term lists are now using the pages frontmatter `linktitle` instead of `title` if set.
---
## 5.26.0 (2024-03-18) {#5260}
- {{% badge style="info" icon="plus-circle" title=" " %}}New{{% /badge %}} The lazy loading of images is now configurable by using the new `lazy` [image effect](cont/imageeffects). The default value hasn't changed in comparison to older versions, you don't need to change anything.

View file

@ -1,4 +1,5 @@
+++
linktitle = "Multilingual"
title = "Multilingual and i18n"
weight = 7
+++

View file

@ -1,4 +1,5 @@
+++
linktitle = "Multilingual"
title = "Multilingual an' i18n"
weight = 7
+++

View file

@ -31,7 +31,7 @@
{{- range $i, $e := $breadcrumbReversed }}
{{- $to := $e }}
{{- $depth = add $depth 1 }}
{{- $title := $to.Title }}
{{- $title := or $to.Params.menuTitle $to.LinkTitle $to.Title }}
{{- if eq $to.Kind "taxonomy" }}
{{- $title = default (default $to.Data.Plural (i18n $to.Data.Plural)) $to.Params.Title }}
{{- else if eq $to.Kind "term" }}