|
1 |
| -{{- $textColor := cond .IsHome "white" "primary" -}} |
| 1 | +{{- $textColor := cond .IsHome "text-white" "text-primary" -}} |
| 2 | +{{- $borderColor := cond .IsHome "border-white" "border-primary" -}} |
2 | 3 | {{- $backgroundColor := cond .IsHome "bg-dark" "bg-white" -}}
|
3 |
| -{{- $navBorderColor := cond .IsHome "border-transparent" "border-primary" -}} |
4 | 4 | {{- $currentRelPermalink := .RelPermalink -}}
|
5 |
| -<nav class="w-full max-h-screen text-{{ $textColor }} fixed {{ $backgroundColor }} shadow-sm z-50"> |
| 5 | +<nav class="w-full max-h-screen {{ $textColor }} fixed {{ $backgroundColor }} shadow-sm z-50"> |
6 | 6 | <div class="flex justify-between items-stretch w-full lg:px-8">
|
7 | 7 | <!-- Regular Navigation -->
|
8 | 8 | <div class="flex items-stretch">
|
9 | 9 | <!-- Toggle Button for Smartphone Navigation -->
|
10 |
| - <button @click="isNavOpen = !isNavOpen" type="button" class="self-center lg:hidden border border-{{ $textColor }} rounded-sm px-2 py-1 mx-2" aria-label="Toggle Navigation"> |
| 10 | + <button @click="isNavOpen = !isNavOpen" type="button" class="self-center lg:hidden border {{ $borderColor }} rounded-sm px-2 py-1 mx-2" aria-label="Toggle Navigation"> |
11 | 11 | <i x-show="isNavOpen" class="fas fa-times fa-fw" x-cloak></i>
|
12 | 12 | <i x-show="!isNavOpen" class="fas fa-bars fa-fw"></i>
|
13 | 13 | </button>
|
|
35 | 35 | </li>
|
36 | 36 | {{- range .Site.Data.nav.RelLinks }}
|
37 | 37 | {{- with $.Site.GetPage . }}
|
38 |
| - {{- $borderColor := cond (hasPrefix $currentRelPermalink .RelPermalink) $textColor "transparent" }} |
39 |
| - <li class="flex items-center mx-2 border-b-2 border-{{ $borderColor }} hover:border-{{ $textColor }}"> |
| 38 | + {{- $navItemBorderColor := cond (hasPrefix $currentRelPermalink .RelPermalink) $borderColor "border-transparent" }} |
| 39 | + <li class="flex items-center mx-2 border-b-2 {{ $navItemBorderColor }} hover:{{ $borderColor }}"> |
40 | 40 | <a class="p-2 hover:no-underline plausible-event-name=nav-{{ replaceRE "^.*/([^/]+)/?$" "$1" .RelPermalink }}" href="{{ .RelPermalink }}">{{ cond (isset .Params "navtitle") .Params.Navtitle .Title }}</a>
|
41 | 41 | </li>
|
42 | 42 | {{- end }}
|
|
93 | 93 | {{- end }}
|
94 | 94 |
|
95 | 95 | <ul class="hidden lg:flex items-stretch list-none m-0">
|
96 |
| - <li class="flex items-center m-3 border-l border-{{ $textColor }}"></li> |
| 96 | + <li class="flex items-center m-3 border-l {{ $borderColor }}"></li> |
97 | 97 |
|
98 | 98 | <li x-data="{ isLangDropdownOpen: false }" class="flex items-center mx-2">
|
99 | 99 | <button @click="isLangDropdownOpen = !isLangDropdownOpen" class="whitespace-nowrap p-2">
|
|
0 commit comments