Skip to content

Comments

fix: resolve 404 images on GitHub Pages website#235

Merged
mholzi merged 1 commit intomainfrom
fix/234-image-404
Feb 21, 2026
Merged

fix: resolve 404 images on GitHub Pages website#235
mholzi merged 1 commit intomainfrom
fix/234-image-404

Conversation

@mholzi
Copy link
Owner

@mholzi mholzi commented Feb 21, 2026

Problem

All images on https://mholzi.github.io/beatify/ returned 404.

Root cause: GitHub Pages was configured to serve from main branch, /docs folder. The images/ directory is at the repo root, not inside docs/ — so relative paths like images/qr-lobby.png in the HTML resolved to docs/images/qr-lobby.png which doesn't exist.

Fix

Replace all relative images/... references in docs/index.html with absolute https://raw.githubusercontent.com/mholzi/beatify/main/images/ URLs.

These serve directly from GitHub's content CDN and work regardless of the Pages source branch configuration. This is a proven pattern for GitHub Pages projects that store assets outside the served directory.

Affected references (10 total):

  • beatify-logo.png (nav logo + footer)
  • icon.svg / icon.png (favicons)
  • qr-lobby.png (hero image)
  • player-gameplay.png / reveal-screen.png / podium-screen.png (screenshots)
  • social-preview.png (og:image + twitter:image — already absolute, unchanged)

Additionally: GitHub Pages source was switched to the gh-pages branch (via API) which already has images/ correctly populated by the deploy workflow (cp -r images docs/images). This fix ensures images work in either Pages configuration.

… Pages

Images were 404 on the live site because:
- GitHub Pages was configured to serve from main/docs
- images/ folder is at repo root, not in docs/
- Relative paths images/* in HTML resolved to docs/images/* which doesn't exist

Fix: Replace all relative images/* references with absolute
https://raw.githubusercontent.com/mholzi/beatify/main/images/* URLs.
These serve directly from GitHub's content CDN and work regardless
of the Pages source branch configuration.

Also: Pages source was switched to gh-pages branch (which has the
images/ folder correctly populated by the deploy workflow), so both
path approaches now work.
@gemini-code-assist
Copy link

Summary of Changes

Hello @mholzi, 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 addresses and resolves the issue of broken image links on the project's GitHub Pages website. By converting relative image paths within the index.html file to absolute URLs sourced from GitHub's content delivery network, all images now load reliably. This change enhances the user experience by ensuring visual content is consistently displayed, regardless of the specific GitHub Pages serving configuration.

Highlights

  • Resolved 404 Image Errors: Fixed all images returning 404 errors on the GitHub Pages website by addressing the root cause of incorrect relative paths.
  • Updated Image References to Absolute URLs: Replaced all relative images/... references in docs/index.html with absolute URLs pointing directly to the GitHub content CDN, ensuring reliable image loading.
  • Ensured Compatibility with GitHub Pages Configurations: The fix ensures images work correctly whether GitHub Pages serves from the main branch's /docs folder or the gh-pages branch, providing robustness to the deployment setup.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • docs/index.html
    • Updated favicon image paths to use absolute GitHub CDN URLs.
    • Modified the main logo image path to an absolute GitHub CDN URL.
    • Changed the hero image path to an absolute GitHub CDN URL.
    • Updated all screenshot image paths to use absolute GitHub CDN URLs.
    • Adjusted the footer logo image path to an absolute GitHub CDN URL.
Activity
  • No activity has been recorded for this pull request yet.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@mholzi mholzi merged commit c3f42a9 into main Feb 21, 2026
5 checks passed
@mholzi mholzi deleted the fix/234-image-404 branch February 21, 2026 07:20
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request addresses 404 image issues by using absolute URLs pointing to GitHub's raw content CDN. No security vulnerabilities were found in the provided code changes. However, hardcoding the repository's full URL and the main branch name is a suboptimal pattern for open-source projects, as it breaks portability for forks and creates a maintenance dependency. For standard assets like favicons and images, using relative paths is recommended, leveraging the gh-pages branch deployment workflow, while absolute URLs remain suitable for Open Graph meta tags.

Comment on lines +30 to +31
<link rel="icon" type="image/svg+xml" href="https://raw.githubusercontent.com/mholzi/beatify/main/images/icon.svg">
<link rel="icon" type="image/png" sizes="192x192" href="https://raw.githubusercontent.com/mholzi/beatify/main/images/icon.png">

Choose a reason for hiding this comment

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

medium

Hardcoding absolute URLs to raw.githubusercontent.com (including the username and branch) makes the project less portable. If the repository is forked or the branch is renamed, these links will continue to point to the original source or break. Since the gh-pages deployment now includes the images/ directory, relative paths are preferred for better maintainability and to take advantage of same-origin loading. This applies to all similar changes in this PR.

Suggested change
<link rel="icon" type="image/svg+xml" href="https://raw.githubusercontent.com/mholzi/beatify/main/images/icon.svg">
<link rel="icon" type="image/png" sizes="192x192" href="https://raw.githubusercontent.com/mholzi/beatify/main/images/icon.png">
<link rel="icon" type="image/svg+xml" href="images/icon.svg">
<link rel="icon" type="image/png" sizes="192x192" href="images/icon.png">

<nav class="nav" aria-label="Main navigation">
<a href="#" class="logo" aria-label="Beatify Home">
<img src="images/beatify-logo.png" alt="Beatify Logo" width="28" height="28" class="logo-img">
<img src="https://raw.githubusercontent.com/mholzi/beatify/main/images/beatify-logo.png" alt="Beatify Logo" width="28" height="28" class="logo-img">

Choose a reason for hiding this comment

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

medium

Use a relative path for the logo image to ensure portability and better performance.

Suggested change
<img src="https://raw.githubusercontent.com/mholzi/beatify/main/images/beatify-logo.png" alt="Beatify Logo" width="28" height="28" class="logo-img">
<img src="images/beatify-logo.png" alt="Beatify Logo" width="28" height="28" class="logo-img">


<div class="hero-image">
<img src="images/qr-lobby.png" alt="Beatify QR code lobby — guests scan to join the music trivia game" width="600" height="400" loading="eager">
<img src="https://raw.githubusercontent.com/mholzi/beatify/main/images/qr-lobby.png" alt="Beatify QR code lobby — guests scan to join the music trivia game" width="600" height="400" loading="eager">

Choose a reason for hiding this comment

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

medium

Use a relative path for the hero image.

Suggested change
<img src="https://raw.githubusercontent.com/mholzi/beatify/main/images/qr-lobby.png" alt="Beatify QR code lobby — guests scan to join the music trivia game" width="600" height="400" loading="eager">
<img src="images/qr-lobby.png" alt="Beatify QR code lobby — guests scan to join the music trivia game" width="600" height="400" loading="eager">

Comment on lines +203 to +211
<img src="https://raw.githubusercontent.com/mholzi/beatify/main/images/player-gameplay.png" alt="Player view — slide to guess the release year" width="320" height="200" loading="lazy">
<p class="screenshot-caption">Slide to guess the release year — every second counts</p>
</div>
<div class="screenshot-card">
<img src="images/reveal-screen.png" alt="Reveal screen — the year drops and gold confetti flies" width="320" height="200" loading="lazy">
<img src="https://raw.githubusercontent.com/mholzi/beatify/main/images/reveal-screen.png" alt="Reveal screen — the year drops and gold confetti flies" width="320" height="200" loading="lazy">
<p class="screenshot-caption">The year drops. The room erupts. Gold confetti for exact guesses.</p>
</div>
<div class="screenshot-card">
<img src="images/podium-screen.png" alt="Podium screen — fireworks, medals, personal stats" width="320" height="200" loading="lazy">
<img src="https://raw.githubusercontent.com/mholzi/beatify/main/images/podium-screen.png" alt="Podium screen — fireworks, medals, personal stats" width="320" height="200" loading="lazy">

Choose a reason for hiding this comment

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

medium

Use relative paths for the screenshot images.

Suggested change
<img src="https://raw.githubusercontent.com/mholzi/beatify/main/images/player-gameplay.png" alt="Player view — slide to guess the release year" width="320" height="200" loading="lazy">
<p class="screenshot-caption">Slide to guess the release year — every second counts</p>
</div>
<div class="screenshot-card">
<img src="images/reveal-screen.png" alt="Reveal screen — the year drops and gold confetti flies" width="320" height="200" loading="lazy">
<img src="https://raw.githubusercontent.com/mholzi/beatify/main/images/reveal-screen.png" alt="Reveal screen — the year drops and gold confetti flies" width="320" height="200" loading="lazy">
<p class="screenshot-caption">The year drops. The room erupts. Gold confetti for exact guesses.</p>
</div>
<div class="screenshot-card">
<img src="images/podium-screen.png" alt="Podium screen — fireworks, medals, personal stats" width="320" height="200" loading="lazy">
<img src="https://raw.githubusercontent.com/mholzi/beatify/main/images/podium-screen.png" alt="Podium screen — fireworks, medals, personal stats" width="320" height="200" loading="lazy">
<img src="images/player-gameplay.png" alt="Player view — slide to guess the release year" width="320" height="200" loading="lazy">
<p class="screenshot-caption">Slide to guess the release year — every second counts</p>
</div>
<div class="screenshot-card">
<img src="images/reveal-screen.png" alt="Reveal screen — the year drops and gold confetti flies" width="320" height="200" loading="lazy">
<p class="screenshot-caption">The year drops. The room erupts. Gold confetti for exact guesses.</p>
</div>
<div class="screenshot-card">
<img src="images/podium-screen.png" alt="Podium screen — fireworks, medals, personal stats" width="320" height="200" loading="lazy">

<div class="container">
<div class="footer-logo">
<img src="images/beatify-logo.png" alt="Beatify" width="24" height="24">
<img src="https://raw.githubusercontent.com/mholzi/beatify/main/images/beatify-logo.png" alt="Beatify" width="24" height="24">

Choose a reason for hiding this comment

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

medium

Use a relative path for the footer logo image.

Suggested change
<img src="https://raw.githubusercontent.com/mholzi/beatify/main/images/beatify-logo.png" alt="Beatify" width="24" height="24">
<img src="images/beatify-logo.png" alt="Beatify" width="24" height="24">

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