Skip to content

feat: enforce alt attributes and add image accessibility docs - #197

Merged
htnabe merged 4 commits into
devfrom
feat/enforce-alt-attributes
Jul 27, 2026
Merged

htnabe merged 4 commits into
devfrom
feat/enforce-alt-attributes

Conversation

@htnabe

@htnabe htnabe commented Jul 26, 2026

Copy link
Copy Markdown
Owner

Overview

This PR enforces explicit alt attribute output for rendered images and adds dedicated image accessibility guidance documents.

Changes

  • Added warning-based alt checks in markdown image rendering.
  • Updated image templates/shortcodes to always output alt attributes.
  • Added dedicated guidance docs for image accessibility in English and Japanese.
  • Kept getting-started guides as quick-start documents and linked to the detailed accessibility docs.
  • Updated README documentation index with new guidance links.

Related Issues

  • N/A

Checklist

  • Self-review done (following review.prompt.md)
  • Hugo production build passes: cd exampleSite && hugo --gc --minify
  • Docs updated if behavior changed
  • No unrelated changes included
  • No unnecessary commented-out code included

Notes for Reviewers

Current enforcement is warning-based to avoid immediate breaking changes. Future tightening to build errors can be done after migration guidance.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 alt attributes 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

Comment thread layouts/shortcodes/img.html Outdated
Comment thread layouts/_default/_markup/render-image.html Outdated
Comment thread docs/guidance/image-accessibility.en.md Outdated
Comment thread docs/guidance/image-accessibility.ja.md Outdated
@htnabe
htnabe merged commit c0cf8c0 into dev Jul 27, 2026
3 checks passed
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.

2 participants