Skip to content

Gallery alt text describes the API, not the picture #213

Description

@TMHSDigital

What

Gallery image alt text describes the API an entry teaches, not what the picture shows.

  • Gallery cards: card_alt() in scripts/build_gallery.py builds "{name} — {first sentence of teaches}", capped at 160 characters. 29 of 79 alts are cut with "…". As of fix(site): finish the Pages review follow-ups #209, the card's image link is aria-hidden, so card alts no longer reach screen readers at all.
  • Detail-page hero and zoom image: "{name} render" and "{name} render, full size".
  • Landing-page cards: "{name} render" (scripts/site/template.html.j2).

"swatch-grid render" tells a screen-reader user nothing about the image. The READMEs already contain good visual descriptions, e.g. showcase/crate-stack/README.md's image alt: "Three shipping crates stacked, each yawed and offset differently".

Proposal

  • Add an optional alt field to each examples/gallery.json / showcase/gallery.json entry: one sentence describing the picture.
  • Use it for the detail-page hero, the zoom image and the landing cards, falling back to today's text.
  • Once backfilled, have build_gallery.py require it for new entries, the way it already guards alts against dotted-path truncation.

79 one-line descriptions: content work, not code.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationenhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions