Localize menu items with translation tables

In the [Hugo documentation](https://gohugo.io/content-management/multilingual/#use-translation-tables) it explains using translation tables as a possible way of localizing menu entries.

This basically uses the menu identifier as a language key for the name of the entry, and is present in the [example menu template](https://gohugo.io/templates/menu-templates/#example).

This change basically gives the same functionality to PaperMod.
This commit is contained in:
Abby Henríquez Tejera 2023-08-14 21:42:41 +02:00 committed by GitHub
parent 9d4a9e825a
commit 709efac637
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -130,7 +130,7 @@
{{- cond $is_search (" accesskey=/" | safeHTMLAttr) ("" | safeHTMLAttr ) }}>
<span {{- if eq $menu_item_url $page_url }} class="active" {{- end }}>
{{- .Pre }}
{{- .Name -}}
{{- or (T .Identifier) .Name -}}
{{ .Post -}}
</span>
{{- if (findRE "://" .URL) }}&nbsp;