From 709efac6371877f08caffb12299bf080084f7d81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Abby=20Henr=C3=ADquez=20Tejera?= Date: Mon, 14 Aug 2023 21:42:41 +0200 Subject: [PATCH] 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. --- layouts/partials/header.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layouts/partials/header.html b/layouts/partials/header.html index 4a7291e2..b810aeac 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -130,7 +130,7 @@ {{- cond $is_search (" accesskey=/" | safeHTMLAttr) ("" | safeHTMLAttr ) }}> {{- .Pre }} - {{- .Name -}} + {{- or (T .Identifier) .Name -}} {{ .Post -}} {{- if (findRE "://" .URL) }}