feat: enforce alt attributes and add image accessibility docs - #197
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves image accessibility across the HikaeMe Hugo theme by ensuring rendered <img> elements always include an alt attribute, introducing warning-based enforcement for missing/empty alt text in some render paths, and adding dedicated documentation for image accessibility (EN/JA) with links from the getting-started guides.
Changes:
- Updated multiple templates/shortcodes to always output
altattributes for images. - Added warning-based checks during Markdown image rendering and shortcode usage to surface missing alt text.
- Added new image accessibility guidance docs (English/Japanese) and linked them from existing getting-started guides.
Reviewed changes
Copilot reviewed 12 out of 13 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| layouts/shortcodes/img.html | Adds alt/caption fallback logic + warning for missing alt; now always emits alt. |
| layouts/shortcodes/amazon.html | Adds an alt attribute for Amazon product images with reasonable defaults. |
| layouts/partials/author.html | Adds an alt attribute to the author thumbnail image. |
| layouts/_default/summary.html | Adds an alt attribute to summary thumbnail images. |
| layouts/_default/_markup/render-image.html | Always emits alt for Markdown images and adds a warning when alt is empty. |
| exampleSite/packages/hugoautogen/package.json | Bumps a few frontend/dev dependency versions. |
| exampleSite/packages/hugoautogen/hugo_packagemeta.json | Updates the autogen metadata checksum to match dependency changes. |
| exampleSite/package-lock.json | Updates lockfile entries consistent with dependency bumps. |
| exampleSite/config/_default/hugo.yaml | Updates Hugo timezone setting to Asia/Tokyo. |
| docs/guidance/image-accessibility.en.md | Adds a dedicated English image accessibility guide. |
| docs/guidance/image-accessibility.ja.md | Adds a dedicated Japanese image accessibility guide. |
| docs/guidance/getting-started.en.md | Links to the new English image accessibility guide. |
| docs/guidance/getting-started.ja.md | Links to the new Japanese image accessibility guide. |
Files not reviewed (1)
- exampleSite/package-lock.json: Generated file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This PR enforces explicit alt attribute output for rendered images and adds dedicated image accessibility guidance documents.
Changes
Related Issues
Checklist
review.prompt.md)cd exampleSite && hugo --gc --minifyNotes for Reviewers
Current enforcement is warning-based to avoid immediate breaking changes. Future tightening to build errors can be done after migration guidance.