all-contributors / all-contributors/cli

alt tag content missing from contributor template

Abierto
#310 3 comentarios 0 reacciones 0 asignados Ver en GitHub
discussion pinned type: enhancement
Lenguaje dominante
JavaScript
Estrellas
425
Forks
149
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

- `all-contributors-cli` version: v6.20.0
- `node` version: v12.22.12
- `npm` (or `yarn`) version: 8.3.0

Relevant code or config

[format-contributor.js](https://github.com/all-contributors/cli/blob/master/src/generate/format-contributor.js#L5)

```javascript
''
```

Problem description:

The image for a contributor has an empty alt text attribute, which looks like it was added in #138 and removed in #218. While best practices for alt-text _is_ to not include it for decorative images, which was the justification for removing it, I contend that profile pictures are not decoration. Profile pictures are part of the contributor's identity -- if they weren't, then there would be no reason for including them in the first place. In my opinion, they fall under the [informative images classification](https://www.w3.org/WAI/tutorials/images/informative/) under the WC3's WAI. More detail can be found in the [WCAG standard itself](https://www.w3.org/TR/WCAG20/#text-equiv).

I'd also reference the [decision tree](https://www.w3.org/WAI/tutorials/images/decision-tree/), which doesn't lend itself to the conclusion that the profile picture is decorative.

Suggested solution:

That being said, the original implementation didn't add much value beyond the name of the profile user. We have the information, so a more comprehensive alt text string can be composed.

I'm currently using `alt=\"<%= contributor.name %>'s GitHub profile picture\"/>` in my template, but other options exist, such as:

* Profile picture of {name}, whose bio is {bio}
* Profile picture of {name}, who has {contribution stats} (using the [contextual user API](https://docs.github.com/en/rest/users/users#get-contextual-information-for-a-user))

or pick your preference.

There is a case to be made that since these images are actually links, then they should adhere to the [functional images classification](https://www.w3.org/WAI/tutorials/images/functional/), in which case the alt text should indicate where it is linking. That might look like "Profile picture of contributor linking to {link}", but it also might be better then to only link to their `html_url` and then be able to standardize on "Picture of contributor linking to their GitHub profile".

Thoughts?

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.