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

Add og:image:alt for accessibility. #3066

Merged
merged 2 commits into from
Jan 23, 2024
Merged

Conversation

aartaka
Copy link
Contributor

@aartaka aartaka commented Jan 19, 2024

Add image alt text in index.html

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

This ensures that the image added via OpenGraph <meta> tag has a proper alt text for use with screen readers or image-less user agents. Leaving the alt text empty is a sane fallback for when the image is purely decorative too.

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Documentation and tests are irrelevant for such a change, right?

@roblarsen
Copy link
Member

I'll have to take a look at this! Thanks for your submission.

@coliff
Copy link
Member

coliff commented Jan 22, 2024

The HTML file needs to be updated in the src/ folder too.
Other than that, 👍 from me.
REF: https://ogp.me/#structured

@aartaka
Copy link
Contributor Author

aartaka commented Jan 22, 2024

Added the code to src/index, docs/html and docs/extend, seems that I've covered everything.

I barely resisted the temptation to add Twitter cards image alt too, but that's for a different PR!

Copy link
Member

@roblarsen roblarsen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@roblarsen roblarsen merged commit 8e6ff2b into h5bp:main Jan 23, 2024
6 checks passed
@aartaka aartaka deleted the opengraph-image-alt branch February 1, 2024 21:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants