Skip to content

Fix Pages: relative asset paths in public/index.html#3

Merged
avanelsas merged 1 commit into
mainfrom
feature/relative-asset-paths
Apr 27, 2026
Merged

Fix Pages: relative asset paths in public/index.html#3
avanelsas merged 1 commit into
mainfrom
feature/relative-asset-paths

Conversation

@avanelsas
Copy link
Copy Markdown
Owner

Summary

The Pages site at https://avanelsas.github.io/bareforge/ serves the editor HTML correctly, but the JS bundle never executes — <script src=\"/js/main.js\"> is absolute, so the browser resolves it against the user-pages root (avanelsas.github.io/js/main.js → 404) instead of the project sub-path (avanelsas.github.io/bareforge/js/main.js, where the file actually lives).

Changing the script src + favicon href to relative paths (js/main.js, favicon.svg) makes the same artefact serve correctly under both the dev server's / root and the project-pages sub-path.

Why this slipped through

Pairs with the earlier shadow-cljs.edn :asset-path \"js\" (relative) change. That fixed only the cljs-side lazy-loaded modules and not the static <script> tag in public/index.html — which is why the Pages deploy ran clean (the artefact uploaded fine) but the deployed app rendered empty.

Test plan

  • All four PR-readiness gates green locally.
  • CI passes the same four gates on this PR.
  • After merge, gh workflow run pages.yml to redeploy. Then curl -s https://avanelsas.github.io/bareforge/ | grep src= should show src=\"js/main.js\" and the editor should actually render in a browser.

The Pages site at https://avanelsas.github.io/bareforge/ was
loading the editor HTML but the bundled JS never executed —
`<script src="/js/main.js">` is absolute, so the browser
resolved it against the user-pages root
(avanelsas.github.io/js/main.js → 404) instead of the project
sub-path (avanelsas.github.io/bareforge/js/main.js, where the
file actually lives).

Changing the script src + favicon href to relative paths
(`js/main.js`, `favicon.svg`) makes the same artefact serve
correctly under both the dev server's `/` root and the
project-pages sub-path. Pairs with the earlier shadow-cljs.edn
:asset-path 'js' (relative) change which fixed only the cljs-side
lazy-loaded modules, not the static <script> tag.

Local gates green: 486 tests / 0 release warnings / clj-kondo
clean / cljfmt clean.
@avanelsas avanelsas merged commit 0ea3299 into main Apr 27, 2026
1 check passed
@avanelsas avanelsas deleted the feature/relative-asset-paths branch April 30, 2026 08:41
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