[Accessibility] Add missing alt attributes to images in collections and layouts#2601
[Accessibility] Add missing alt attributes to images in collections and layouts#2601bhavyamsharmaa wants to merge 2 commits intomeshery:masterfrom
Conversation
…youts Signed-off-by: Bhavyam <positionbhavyamsharma@gmail.com>
✅ Deploy Preview for mesheryio-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Summary of ChangesHello @bhavyamsharmaa, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request focuses on a crucial accessibility and SEO improvement by systematically adding Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request primarily adds alt attributes to numerous <img> tags across various HTML and Markdown files to improve accessibility. Specifically, alt attributes were added to images in _layouts/single-page-extension.html, _layouts/single-page-model.html, collections/_pages/brand.html, collections/_pages/community.html, collections/_pages/recognition.md, and several blog posts (collections/_posts).
The review comments highlight several issues: merge conflicts in _layouts/single-page-model.html that need resolution, and incorrect or non-descriptive alt attribute values. For instance, alt="{{Page" and alt="{{ Component" in the layout files are syntactically incorrect and should be updated to use proper Liquid syntax like alt="{{ page.title }}" or alt="{{ component.name }}". Additionally, several alt="Shape" attributes in collections/_pages/community.html are identified as decorative and should be changed to alt="", while alt="Site" in a blog post is deemed insufficiently descriptive and a more detailed alternative is suggested.
_layouts/single-page-extension.html
Outdated
| data-snapshot-dark="{{page.whiteImage}}" | ||
| src="{{page.colorImage}}" | ||
| onerror="this.src='/assets/images/meshery-color.svg'" loading="lazy" onclick="toggleFullScreenImage('{{ page.colorImage }}', 'extension')" /> | ||
| onerror="this.src='/assets/images/meshery-color.svg'" loading="lazy" onclick="toggleFullScreenImage('{{ page.colorImage }}', 'extension')" alt="{{Page" /> |
There was a problem hiding this comment.
The alt attribute has invalid Liquid syntax ({{Page). It's missing the closing braces and the variable name might be incorrect. For an extension page, using the page title as the alt text is a good practice.
onerror="this.src='/assets/images/meshery-color.svg'" loading="lazy" onclick="toggleFullScreenImage('{{ page.colorImage }}', 'extension')" alt="{{ page.title }}" />
_layouts/single-page-model.html
Outdated
| <<<<<<< Updated upstream | ||
| <img class="image-class" | ||
| data-snapshot-light="{{ page.colorIcon }}" | ||
| data-snapshot-dark="{{ page.whiteIcon }}" | ||
| src="{{ page.colorIcon }}" | ||
| onerror="this.src='/assets/images/meshery-color.svg'" | ||
| loading="lazy" | ||
| onclick="toggleFullScreenImage('{{ page.colorIcon }}', 'model')" /> | ||
| ======= | ||
| <img class="image-class" data-snapshot-light="{{ page.colorIcon }}" data-snapshot-dark="{{ page.whiteIcon }}" | ||
| src="{{ page.colorIcon }}" onerror="this.src='/assets/images/meshery-color.svg'" loading="lazy" | ||
| onclick="toggleFullScreenImage('{{ page.colorIcon }}', 'model')" alt="{{ Page" /> | ||
| >>>>>>> Stashed changes |
There was a problem hiding this comment.
_layouts/single-page-model.html
Outdated
| <<<<<<< Updated upstream | ||
| <div style="text-align: center; width: 150px;"> | ||
| <img src="{{site.baseurl}}/{{ component.colorIcon }}" | ||
| onerror="this.src='/assets/images/meshery-color.svg'" | ||
| style="width: 100px; height: 100px; object-fit: contain;" | ||
| loading="lazy" /> | ||
| <p><strong>{{ component.name }}</strong></p> | ||
| </div> | ||
| ======= | ||
| <div style="text-align: center; width: 150px;"> | ||
| <img src="{{site.baseurl}}/{{ component.colorIcon }}" onerror="this.src='/assets/images/meshery-color.svg'" | ||
| style="width: 100px; height: 100px; object-fit: contain;" loading="lazy" alt="{{ Component" /> | ||
| <p><strong>{{ component.name }}</strong></p> | ||
| </div> | ||
| >>>>>>> Stashed changes |
There was a problem hiding this comment.
collections/_pages/community.html
Outdated
| <div class="heading-shape"> | ||
| <h2 class="margin-padding-none">User Tutorials</h2> | ||
| <img src="../../assets/images/resources-section/svg/shape.svg" /> | ||
| <img src="../../assets/images/resources-section/svg/shape.svg" alt="Shape" /> |
There was a problem hiding this comment.
This image appears to be decorative. For decorative images, it's best practice to use an empty alt attribute (alt="") to signal to screen readers that they can be ignored. The current alt="Shape" does not provide meaningful information.
| <img src="../../assets/images/resources-section/svg/shape.svg" alt="Shape" /> | |
| <img src="../../assets/images/resources-section/svg/shape.svg" alt="" /> |
collections/_pages/community.html
Outdated
| <div class="heading-shape"> | ||
| <h2 class="margin-padding-none">Contributor Training</h2> | ||
| <img src="../../assets/images/resources-section/svg/shape.svg" /> | ||
| <img src="../../assets/images/resources-section/svg/shape.svg" alt="Shape" /> |
There was a problem hiding this comment.
This image appears to be decorative. For decorative images, it's best practice to use an empty alt attribute (alt="") to signal to screen readers that they can be ignored. The current alt="Shape" does not provide meaningful information.
| <img src="../../assets/images/resources-section/svg/shape.svg" alt="Shape" /> | |
| <img src="../../assets/images/resources-section/svg/shape.svg" alt="" /> |
collections/_pages/community.html
Outdated
| <div class="heading-shape"> | ||
| <h2 class="margin-padding-none">Docs</h2> | ||
| <img src="../../assets/images/resources-section/svg/shape.svg" /> | ||
| <img src="../../assets/images/resources-section/svg/shape.svg" alt="Shape" /> |
There was a problem hiding this comment.
This image appears to be decorative. For decorative images, it's best practice to use an empty alt attribute (alt="") to signal to screen readers that they can be ignored. The current alt="Shape" does not provide meaningful information.
| <img src="../../assets/images/resources-section/svg/shape.svg" alt="Shape" /> | |
| <img src="../../assets/images/resources-section/svg/shape.svg" alt="" /> |
collections/_pages/community.html
Outdated
| <div class="heading-shape"> | ||
| <h2 class="margin-padding-none">Newcomers Journey</h2> | ||
| <img src="../../assets/images/resources-section/svg/shape.svg" /> | ||
| <img src="../../assets/images/resources-section/svg/shape.svg" alt="Shape" /> |
There was a problem hiding this comment.
This image appears to be decorative. For decorative images, it's best practice to use an empty alt attribute (alt="") to signal to screen readers that they can be ignored. The current alt="Shape" does not provide meaningful information.
| <img src="../../assets/images/resources-section/svg/shape.svg" alt="Shape" /> | |
| <img src="../../assets/images/resources-section/svg/shape.svg" alt="" /> |
collections/_pages/community.html
Outdated
| <div class="heading-shape"> | ||
| <h2 class="margin-padding-none">Playgrounds</h2> | ||
| <img src="../../assets/images/resources-section/svg/shape.svg" /> | ||
| <img src="../../assets/images/resources-section/svg/shape.svg" alt="Shape" /> |
There was a problem hiding this comment.
This image appears to be decorative. For decorative images, it's best practice to use an empty alt attribute (alt="") to signal to screen readers that they can be ignored. The current alt="Shape" does not provide meaningful information.
| <img src="../../assets/images/resources-section/svg/shape.svg" alt="Shape" /> | |
| <img src="../../assets/images/resources-section/svg/shape.svg" alt="" /> |
| Meshery is proud to announce the release of the Shape Builder extension—a powerful tool that allows you to create custom polygon shapes to visually design and manage your cloud native infrastructure. This extension further enriches the Meshery platform, empowering users to craft detailed architecture diagrams that are tailored to their unique deployments. | ||
|
|
||
| <img src="https://raw.githubusercontent.com/meshery-extensions/shape-builder/98531eecdd2c5b01895f1d818f824bf186bf6077/.github/assets/images/site.png" width="100%" align="center" /> | ||
| <img src="https://raw.githubusercontent.com/meshery-extensions/shape-builder/98531eecdd2c5b01895f1d818f824bf186bf6077/.github/assets/images/site.png" width="100%" align="center" alt="Site" /> |
There was a problem hiding this comment.
The alt text "Site" is not descriptive. A more meaningful alt text, such as "Shape Builder extension user interface", would better describe the image content for users of screen readers.
| <img src="https://raw.githubusercontent.com/meshery-extensions/shape-builder/98531eecdd2c5b01895f1d818f824bf186bf6077/.github/assets/images/site.png" width="100%" align="center" alt="Site" /> | |
| <img src="https://raw.githubusercontent.com/meshery-extensions/shape-builder/98531eecdd2c5b01895f1d818f824bf186bf6077/.github/assets/images/site.png" width="100%" align="center" alt="Shape Builder extension user interface" /> |
Signed-off-by: Bhavyam <positionbhavyamsharma@gmail.com>
|
@bhavyamsharmaa Thank you for your contribution! Let's discuss this during the website call today at 6:30 PM IST | 7 AM CST Add it as an agenda item to the meeting minutes, if you would 🙂 |
Description
This PR fixes #2598
Instead of leaving images without alt tags and hurting SEO, I went through the collections and _layouts folders to add alt attributes to all the missing img tags. Pulled the text for the alt tags mostly from the image source names to make them descriptive enough for screen readers.
Notes for Reviewers
Checked locally, no broken images. This specifically addresses the missing alt issue on blog posts and single page models.
Signed commits