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

Avoid adding extra / on hits #91

Merged
merged 1 commit into from
Nov 14, 2022

Conversation

daddykotex
Copy link
Contributor

say we got doc.url = /docs/intro.html

with baseUrl = '/', the condition failed because doc.url starts with a /, so we returned `doc.url

with baseUrl = /some-thing/, the condition succeeds because baseUrl is not /, so we return the concatenated url, but it's wrong. it gives: /some-thing//docs/intro.html

The thing is that the doc.url already contains the baseUrl, so there is no need to concatenate.

Again running off the docusaurus getting started and applying the fix locally:

baseUrl = /:
Screen Shot 2022-11-11 at 09 47 38

baseUrl = /some-thing/:
Screen Shot 2022-11-11 at 09 48 35

This is a follow up to #89 and #88

say we got doc.url = /docs/intro.html

with baseUrl = '/', the condition failed because doc.url starts with
a `/`, so we returned `doc.url

with baseUrl = `/some-thing/`, the condition succeeds because baseUrl
is not `/`, so we return the concatenated url, but it's wrong. it gives:
`/some-thing//docs/intro.html`

The thing is that the doc.url already contains the baseUrl, so there
is no need to concatenate.
@windhamdavid
Copy link

windhamdavid commented Nov 13, 2022

@praveenn77 & @daddykotex - I can confirm this base URL issue with v2.3.1 & Docusaurus v2.2.0. ( edit: and I just rebuilt to test. I'm getting baseUrl/ + /baseUrl ... and I can confirm that this pull request fixes it )

Screenshot 2022-11-13 at 6 33 27 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants