maddalax / htmgo

htmgo - build simple and scalable systems with go + htmx
https://htmgo.dev
MIT License
740 stars 19 forks source link

add title and lang to increase google web accessibility score. #61

Open gedw99 opened 1 month ago

gedw99 commented 1 month ago
<html hx-ext="path-deps, response-targets, mutation-error, htmgo, sse">

add title element

add lang param

this is common to all...

gedw99 commented 1 month ago

I can PR this . Actually could not find the code that does this in the framework . It’s a bit abstract :) if you can point me to the area it would be fab

was thinking of adding a sub command to allow use to run this on any example too .

k6 is a pretty cool system for doing web testing too.

https://github.com/grafana/k6

maddalax commented 1 month ago

Are you referring to the meta attributes? The framework itself doesn't add it, they are defined in the starter template itself, on the RootPage

gedw99 commented 1 month ago

Yes I am .

Ok thanks . Will have a look .

the scores for everything are 100 % btw :)

75 % for accessibility..

gedw99 commented 1 month ago

Yep the html that needs fixing is here : https://github.com/maddalax/htmgo/blob/master/templates/starter/pages/root.go

will manually fix everything for now …

This can be manually fixed but it has 2 shortcomings:

  1. all other apps / examples miss out on the fix.
  2. We have a discussion about doing LTR / RTL already : https://github.com/maddalax/htmgo/discussions/41

I need to think about the best way for framework generated and developer generated code to alter the final html.

I suspect it starts with just adding framework level code to detect the locale etc, so that developer code can use it where needed later.

Further down the road, we will see where the framework can create the code for the developer at Run time or Generation time for these features that are common to Apps.

It’s important that certain things are opt in. Maybe all things ..

If anyone has thoughts on this would love to hear it .