Repository navigation
fix(website): resolve the footer logo against the site base url - #425
Open
IanoNjuguna wants to merge 1 commit into
Open
IanoNjuguna wants to merge 1 commit into
IanoNjuguna wants to merge 1 commit into
Conversation
logo.src was rendered verbatim, and the config writes it without a leading slash, so the mark loaded on / and 404'd on every docs page. useBaseUrl is what the stock navbar and footer do with the same value.
This branch has not been deployed
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.
Description
The footer rendered
<img src="img/intersect-logo.png">, the raw config string with no leading slash, so it resolved against the current route: fine on/, a 404 on every docs page.logo.srcnow goes throughuseBaseUrl, which is what the stock navbar and the stock footer do with the same value. The config keeps the relative path, because that is the convention both of those follow.One line of behaviour plus the import, and a comment saying why, since the next person to swizzle this footer will otherwise re-introduce it.
Fixes #424.
Type of Change
Testing
Checklist
Verification
Before the change the first of those read
src="img/intersect-logo.png", which is the request that 404s.Notes
if (!footer) return null, so the hook order stays unconditional. Putting it after the early return would have worked on the current config and broken the rules of hooks the first time the footer were made optional.onBrokenLinksnever sees it. A<img>whose src is a plain string is invisible to every check we run, which is worth remembering for other swizzled assets.src: "/img/intersect-logo.png"in the config, works today but breaks if the site is ever served under a subpath, and it would leave the navbar and footer using two different conventions.