Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alt text missing on catalog grid images #904

Open
1 task done
bjhewitt opened this issue Feb 23, 2024 · 1 comment
Open
1 task done

Alt text missing on catalog grid images #904

bjhewitt opened this issue Feb 23, 2024 · 1 comment
Assignees
Labels
status:triage needed Issue needs to be triaged by the Quire team. This label is automatically applied to new issues. workaround Issue has a workaround

Comments

@bjhewitt
Copy link

Before proceeding, make sure there isn’t an existing issue for this bug.

  • I have searched the existing issues and determined this is a new bug.

Expected Behavior

Figure images in the object catalog grid should include alt text.

Actual Behavior

Catalog object grid images have empty alt tag. Figures included throughout body do include alt text.

Steps to Reproduce

Alt text has been added to all figures in figures.yaml. I have also added alt text to one object in the objects.yaml object_list. When site is built (preview or build), grid image alt tags are empty

Version Numbers

1.0.0-rc.11

Web Browser

all

Relevant Terminal/Shell Output

No response

Supporting Information

Data and files available at https://github.com/bjhewitt/quire-cmog-roman-glassblowing

@bjhewitt bjhewitt added the status:triage needed Issue needs to be triaged by the Quire team. This label is automatically applied to new issues. label Feb 23, 2024
@geealbers
Copy link
Member

Thanks for posting @bjhewitt. I agree, those images should definitely include their alt test. Until this is fixed in core Quire, there's a fix you can try on your own.

In _includes/components/table-of-contents/item/grid.js you'll find two instances of a tableOfContentsImage() function. First, update those two lines to pass the alt text into the function like this:

? tableOfContentsImage({ src: firstFigure.src, alt: firstFigure.alt })
? tableOfContentsImage({ src: firstObjectFigure.src, alt: firstObjectFigure.alt })

Then, in _includes/components/table-of-contents/item/image.js, declare the alt constant (line 14):

const { alt, src } = params

And finally, pass that in to the HTML markup that's being returned (line 20):

<img src="${ imgPath }" alt="${alt}" />

I tested this here and it worked for me, but let us know if it doesn't for you.

@geealbers geealbers added the workaround Issue has a workaround label Feb 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:triage needed Issue needs to be triaged by the Quire team. This label is automatically applied to new issues. workaround Issue has a workaround
Projects
None yet
Development

No branches or pull requests

3 participants