Skip to content

Fix broken image paths in people, project, and software layouts#94

Merged
kltm merged 1 commit intomasterfrom
fix/relative-image-paths
Feb 18, 2026
Merged

Fix broken image paths in people, project, and software layouts#94
kltm merged 1 commit intomasterfrom
fix/relative-image-paths

Conversation

@kltm
Copy link
Member

@kltm kltm commented Feb 18, 2026

Summary

  • Make relative image/logo src attributes absolute by prepending page.url in all three layouts (people.html, project.html, software.html)
  • External URLs (containing ://) are left unchanged
  • Fixes 404s for all people profile photos (~15 people affected) and relative project/software logos (CCDH, Apollo)

Problem

The layouts used bare relative paths like <img src="seth.jpg">. When a page is accessed without a trailing slash (e.g., /people/seth-carbon instead of /people/seth-carbon/), the browser resolves seth.jpg relative to /people/ rather than /people/seth-carbon/, producing a 404.

Fix

For local filenames, prepend {{page.url}} (which always includes the trailing slash for index.md files), producing absolute paths like /people/seth-carbon/seth.jpg. External URLs are detected via contains '://' and passed through unchanged.

Test plan

  • Verify people profile photos load correctly (e.g., /people/seth-carbon, /people/nomi-harris)
  • Verify CCDH project logo loads at /project/ccdh
  • Verify Apollo software logo loads at /software/apollo
  • Verify external logos still work (e.g., Gene Ontology, Monarch, Exomiser)
  • Test pages both with and without trailing slash

🤖 Generated with Claude Code

Layouts were using bare relative paths (e.g. src="seth.jpg") for
page.image/page.logo. These resolve incorrectly when the page URL
lacks a trailing slash, causing 404s for all people photos and some
project/software logos. Now prepend page.url for local filenames
while leaving external URLs (containing ://) unchanged.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@nlharris
Copy link
Member

nlharris commented Feb 18, 2026

The layouts used bare relative paths like . When a page is accessed without a trailing slash (e.g., /people/seth-carbon instead of /people/seth-carbon/), the browser resolves seth.jpg relative to /people/ rather than /people/seth-carbon/, producing a 404.

Huh, I hadn't thought to test that.

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

Comments