Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the flutter SDK search box loading on non-root pages with --use-base-href #2158

Merged
merged 2 commits into from
Mar 4, 2020

Conversation

jcollins-g
Copy link
Contributor

Fixes #2157.

This combines the attempts in #2118 and #2125 into something that works for the case in Flutter where they've changed the directory level of everything except the index to one down (under flutter/), and rewritten the href on the index page accordingly. I didn't notice this as the serve-flutter-docs grinder doesn't do that hack and I didn't stop to think about the implications of that at the time... Also, serve-flutter-docs doesn't use --use-base-href so a manual test verifying the search box worked with that wouldn't have helped in any event.

I'm open to a better way of doing this in javascript, but I have tried several alternatives (including trying to read the base tag directly) and this seems to be the one that works reliably.

@googlebot googlebot added the cla: yes Google CLA check succeeded. label Mar 4, 2020
@jcollins-g jcollins-g requested review from jdkoren and srawlins March 4, 2020 22:11
@jcollins-g jcollins-g merged commit 6aa2a97 into master Mar 4, 2020
@coveralls
Copy link

Coverage Status

Coverage remained the same at 93.564% when pulling 8f4765f on flutter-search-box into c535249 on master.

@jcollins-g jcollins-g deleted the flutter-search-box branch April 27, 2020 20:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Google CLA check succeeded.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0.30.1 on Flutter with --use-base-href links to wrong location for search index on some pages
5 participants