From: Danilo M. Date: Wed, 29 Apr 2026 11:13:30 +0000 (+0200) Subject: feat: external links in main menu — A11y new-tab label + workflow docs X-Git-Tag: release_29042026-1314^2 X-Git-Url: https://git.danix.xyz/?a=commitdiff_plain;h=dc4eba2c6a709995a2f4718f9fb407f3057a13b8;p=danix.xyz-2.git feat: external links in main menu — A11y new-tab label + workflow docs Co-Authored-By: Claude Sonnet 4.6 --- diff --git a/WORKFLOW.md b/WORKFLOW.md index c95141f..13a6da3 100644 --- a/WORKFLOW.md +++ b/WORKFLOW.md @@ -83,6 +83,24 @@ The banner appears automatically below the article header. If `successor` is set Paths are Hugo permalinks — for English articles, use `/articles/slug`, not `/en/articles/slug`. +### Add an external link to the main menu + +Add a menu entry in `hugo.toml` with `params.external = true`: + +```toml +[[menus.main]] + name = "GitHub" + url = "https://github.com/youruser" + weight = 10 + [menus.main.params] + external = true +``` + +- `name` is used as-is (not looked up in i18n) +- `url` must be a full URL including scheme +- `weight` controls order relative to other menu items +- External links open in a new tab with `rel="noopener noreferrer"` and include a screen-reader-only "(opens in new tab)" label for WCAG 2.1 AA compliance + --- ## Working on the Theme diff --git a/i18n/en.yaml b/i18n/en.yaml index 65a5b1a..bf35bb4 100644 --- a/i18n/en.yaml +++ b/i18n/en.yaml @@ -10,6 +10,7 @@ toggleTheme: "Theme" toggleMenu: "Menu" closeMenu: "Close" mainMenu: "Main navigation" +opensInNewTab: "(opens in new tab)" skipToContent: "Skip to main content" email: "Email" contact: "Contact" diff --git a/i18n/it.yaml b/i18n/it.yaml index 3e4a7a4..31424ea 100644 --- a/i18n/it.yaml +++ b/i18n/it.yaml @@ -10,6 +10,7 @@ toggleTheme: "Tema" toggleMenu: "Menu" closeMenu: "Chiudi" mainMenu: "Navigazione principale" +opensInNewTab: "(si apre in una nuova scheda)" skipToContent: "Salta al contenuto principale" email: "Email" contact: "Contatti" diff --git a/themes/danix-xyz-hacker b/themes/danix-xyz-hacker index 1815a96..997ea90 160000 --- a/themes/danix-xyz-hacker +++ b/themes/danix-xyz-hacker @@ -1 +1 @@ -Subproject commit 1815a9655e832a689891ee0843c8f5633a1bb4f5 +Subproject commit 997ea90b7f85329476771e8b30a38fb86c18a07f