Fix: resolve 404 page asset loading on nested routes#1077
Fix: resolve 404 page asset loading on nested routes#1077Bhumikagarggg wants to merge 3 commits into
Conversation
Signed-off-by: Bhumika Garg <bhumikatech2024@gmail.com>
There was a problem hiding this comment.
Code Review
This pull request updates the 404 error page template to support PR previews by dynamically setting the base URL and adding a redirection script. The review feedback highlights a potential issue where a missing trailing slash in the HUGO_PREVIEW_BASE_URL environment variable could cause relative asset URLs to resolve incorrectly, and provides a suggestion to safely append it.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
🚀 Preview deployment: https://layer5io.github.io/docs/pr-preview/pr-1077/
|
Signed-off-by: Bhumika Garg <bhumikatech2024@gmail.com>
Signed-off-by: Bhumika Garg <bhumikatech2024@gmail.com>
miacycle
left a comment
There was a problem hiding this comment.
Duplicate of #1066? @Bhumikagarggg @CodexRaunak
hey @miacycle ! Thanks for sharing PR #1066. I checked both approaches. PR #1066 fixes the issue by injecting a My PR on
So PR #1066 mainly fixes asset loading by adding a dynamic base tag in the shared head partial, while my PR handles both parts of the bug:
That makes my fix more targeted to the actual 404 page and more reliable for both local and preview deployments. |
Notes for Reviewers
/foo/bar) by ensuring assets resolve correctly from the appropriate base path./pr-preview/pr-<number>/./pr-preview/pr-1073/jare currently served by the root GitHub Pages404.html, not the preview folder’s404.html. As a result, the exact preview behavior will fully work after the root404.htmlis deployed with this redirect logic (post-merge production deploy).Screenshot

Signed commits