all repos — searchix @ 00eb7541d54e76f8b55fe499d6955786927b207b

Search engine for NixOS, nix-darwin, home-manager and NUR users

style: highlight current search menu item
Alan Pearce alan@alanpearce.eu
Fri, 10 May 2024 12:11:03 +0200
commit

00eb7541d54e76f8b55fe499d6955786927b207b

parent

42dd2f64f288a7474f356a8ae90e7409b7e38fb6

1 files changed, 5 insertions(+), 1 deletions(-)

jump to
M frontend/templates/index.gotmplfrontend/templates/index.gotmpl
@@ -12,7 +12,11 @@ <header>       <nav>
         <h1><a href="/">Searchix</a></h1>
         {{- range $key, $value := .Sources }}
-          <a href="/options/{{ $key }}/search">{{ $value.Name }}</a>
+          <a
+            {{ if eq $.Source.Name $value.Name }}class="current"{{ end }}
+            href="/options/{{ $key }}/search"
+            >{{ $value.Name }}</a
+          >
         {{- end }}
       </nav>
     </header>