The baseUrl is not reflected in the URL generated by SearchBar. #2827
Labels
bug
An error in the Docusaurus core causing instability or issues with its execution
status: needs triage
This issue has not been triaged by maintainers
The baseUrl is not reflected in the URL generated by SearchBar.
🐛 Bug Report
When we input a word in the SearchBar, the page should transit to "Search results" page.
However, the URL of this page does not reflect the
baseUrl
setting.For example, consider the case
url='https://xyz.github.io'
,baseUrl='/test123/'
and a search-target-word isapple
.I thinks expected generated URL should be 'https://xyz.github.io/test123/search?q=apple' but actual result is 'https://xyz.github.io/search?q=apple' so that we cannot access to "Search results" page from the Search bar.
Have you read the Contributing Guidelines on issues?
Yes!
To Reproduce
(Set
baseUrl
other than/
beforehand.)The issue occurred.
Expected behavior
The generated URL should be
<url> + <baseUrl> + 'search?q=<word>'
.Actual Behavior
The generated URL is wrong because the URL is
<url> + '/search?q=<word>'
and does not includebaseUrl
.Your Environment
v2.0.0-alpha.56
81.0.4044.138
, Node.jsv12.16.2
Reproducible Demo
https://tetunori.github.io/p5.toio/
https://github.com/tetunori/p5.toio
Notes
I've just looked at the source codes for a moment and found that, at here, it seems this URL does not reflect
baseURL
.So I think we need add/change the code like below and it worked fine in my environment.
Please confirm it.
The text was updated successfully, but these errors were encountered: