Skip to content

Fix component loading 404 errors on GitHub Pages#9

Merged
attogram merged 1 commit into
mainfrom
fix-component-paths
Sep 17, 2025
Merged

Fix component loading 404 errors on GitHub Pages#9
attogram merged 1 commit into
mainfrom
fix-component-paths

Conversation

@google-labs-jules
Copy link
Copy Markdown
Contributor

Corrects the paths used to fetch shared HTML components (header, nav, footer) to be relative instead of absolute. This fixes 404 errors when the site is hosted in a subdirectory on GitHub Pages, allowing the page to load correctly.


PR created automatically by Jules for task 472309142665937883

The `script.js` was using absolute paths (e.g., `/header.html`) to fetch shared components. When the site is hosted on GitHub Pages under a subdirectory defined by a `<base>` tag (e.g., `/static-magic/`), these absolute paths resolved incorrectly to the root of the domain, causing 404 errors and preventing the components from loading.

This commit changes the URLs to be relative (e.g., `header.html`). This allows the browser to correctly combine the relative path with the `href` from the `<base>` tag, ensuring that components are fetched from the correct subdirectory.
@google-labs-jules
Copy link
Copy Markdown
Contributor Author

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll acknowledge your comments with a 👀 emoji and then get to work. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

I will automatically address your feedback. For any comments you don't want me to act on, just include (aside).



For security, I will only act on instructions from the user who triggered this task for this pull request.

@attogram attogram marked this pull request as ready for review September 17, 2025 11:31
@attogram attogram merged commit 929435d into main Sep 17, 2025
1 check passed
@attogram attogram deleted the fix-component-paths branch September 17, 2025 11:31
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