HDDS-16234. Favicon missing on all non-root pages - #534
Open
shuan1026 wants to merge 1 commit into
Open
Conversation
Contributor
|
@shuan1026 thanks for the report. Please consider including a screenshot in the future. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
The favicon
<link>tags indocusaurus.config.js'sheadTagsused relativehrefvalues (e.g.href: 'favicon.ico') with no leading/. Since there's no<base>tag on the page, browsers resolve these relative to the current page URL rather than the site root. This only happened to work on/(resolves to/favicon.ico, 200); on any other page it resolved to a nested, non-existent path (e.g./blog/favicon.ico, 404), so the favicon failed to load on every non-root page (docs, blog, roadmap, etc.).This PR makes the three
headTagsfavicon entries build theirhreffrom the site'sbaseUrlinstead of hardcoding a bare relative path, so they always resolve to the site root regardless of page depth.What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-16234
How was this patch tested?
Reproduced the bug first, then verified the fix, using docker compose
curlagainst/,/docs/.../ozone-manager/, and/blog/all emitted the same relativehref="favicon.ico"markup, but the resolved nested path (e.g./docs/.../ozone-manager/favicon.ico) returned 404 while the root path returned 200 — confirming the bug.href="/favicon.ico"(andfavicon.svg,apple-touch-icon.png), which all resolve to 200 regardless of page depth.Before the fix:

After the fix:
