Apply same active-page detection logic used in hamburger menu to desktop
navigation. Desktop nav now shows purple accent color + bold font and
aria-current=page attribute when viewing the linked page. Works for both
EN and IT languages.
<!-- Desktop menu (hidden on mobile) -->
<div class="hidden md:flex items-center gap-8">
+ {{ $currentPath := strings.TrimSuffix "/" .RelPermalink }}
{{ range .Site.Menus.main }}
- <a href="{{ .URL }}" class="text-sm hover:text-accent transition-colors">
+ {{ $menuPath := strings.TrimSuffix "/" .URL }}
+ {{ $isActive := eq $menuPath $currentPath }}
+ <a
+ href="{{ .URL }}"
+ class="text-sm transition-colors {{ if $isActive }}text-accent font-bold{{ else }}hover:text-accent{{ end }}"
+ {{ if $isActive }}aria-current="page"{{ end }}
+ >
{{ i18n .Name }}
</a>
{{ end }}