fix: declare current nav item in a more accessible manner https://github.com/kevquirk/simple.css/wiki/Utility-elements-and-classes#current-nav-item https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Attributes/aria-current
1 file changed, 5 insertions(+), 5 deletions(-)
changed files
M internal/components/page.go → internal/components/page.go
@@ -8,7 +8,6 @@ "alin.ovh/searchix/frontend" "alin.ovh/searchix/internal/config" g "alin.ovh/gomponents" - c "alin.ovh/gomponents/components" . "alin.ovh/gomponents/html" )@@ -71,9 +70,10 @@ Nav( H1(A(Href("/"), g.Text("Searchix"))), g.If(len(tdata.Sources) > 0, A( - c.Classes{ - "current": tdata.Source.Importer == config.All, - }, + g.If( + tdata.Source.Importer == config.All, + Aria("current", "page"), + ), g.If( tdata.Source.Importer == config.All, Href("/"),@@ -85,7 +85,7 @@ ), g.Map(tdata.Sources, func(source config.Source) g.Node { if tdata.Source.Importer != config.All && tdata.Source.Name == source.Name { return A( - Class("current"), + Aria("current", "page"), Href( joinPath( "/",