Skip to content

Reserve image space site-wide; - #884

Draft
richarddushime wants to merge 1 commit into
mainfrom
issue#869
Draft

Reserve image space site-wide;#884
richarddushime wants to merge 1 commit into
mainfrom
issue#869

Conversation

@richarddushime

Copy link
Copy Markdown
Contributor

Description

The alt half of #869 landed in #882 — no image on any of the 7,283 built pages is missing an alt attribute. The dimension half had not: only 25.7% of the site's 22,248 images carried both width and height, so the browser could not reserve their boxes before the files loaded.

  • Markdown images get width/height from the page bundle's resource, or from static/, via a new render-image hook. img { height: auto; max-width: 100% } in the stylesheet means the attributes fix the aspect ratio without freezing the rendered size.
  • The navbar logo carries its dimensions on every page. Hugo cannot measure an SVG, so functions/logo_dims reads the root viewBox; the stylesheet sizes the logo by height with width: auto, which previously left the brand's width unknown until the file arrived and shifted the menu sideways.
  • The chatbot launcher and the FORWARD SDG badges carry theirs too.
  • The UNESCO recognition image, floated at width 200 in two content files, gets the matching height.
  • teamwork.webp on the homepage described a megaphone, copy-pasted from the feature above it.
  • check_seo_html.py gains hard check 5 (every homepage image sized) and reports site-wide coverage; it fails on the pre-fix build and passes on this one.

Fixes # (issue)

Type of Change

  • Content/documentation update
  • Bug fix

Testing

Checklist

  • Self-reviewed my changes
  • Verified links and formatting are correct
  • No new warnings or errors

Notes

The alt half of #869 landed in #882 — no image on any of the 7,283 built pages
is missing an alt attribute. The intrinsic-dimension half had not: only 25.7% of
the site's 22,248 images carried both width and height, so the browser could not
reserve their boxes before the files loaded.

- Markdown images get width/height from the page bundle's resource, or from
  static/, via a new render-image hook. `img { height: auto; max-width: 100% }`
  in the stylesheet means the attributes fix the aspect ratio without freezing
  the rendered size.
- The navbar logo carries its dimensions on every page. Hugo cannot measure an
  SVG, so functions/logo_dims reads the root viewBox; the stylesheet sizes the
  logo by height with `width: auto`, which previously left the brand's width
  unknown until the file arrived and shifted the menu sideways.
- The chatbot launcher and the FORWARD SDG badges carry theirs too.
- The UNESCO recognition image, floated at width 200 in two content files, gets
  the matching height.
- `teamwork.webp` on the homepage described a megaphone, copy-pasted from the
  feature above it.
- check_seo_html.py gains hard check 5 (every homepage image sized) and reports
  site-wide coverage; it fails on the pre-fix build and passes on this one.

Coverage goes from 25.7% to 98.8%; the remainder are remote SVGs and avatars
already sized in CSS. A tag-by-tag diff of all 22,248 images across both builds
shows no change to any src or attribute other than the added dimensions and the
one intended alt.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

👍 All image files/references (if any) are in webp format, in line with our policy.

@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

✅ Spell Check Passed

No spelling issues found when checking 9 changed file(s)! 🎉

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.

1 participant