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

[Bug]: Left sidebar disappeared when URL includes .html #933

Closed
chenjiahan opened this issue Apr 10, 2024 · 3 comments · Fixed by #982
Closed

[Bug]: Left sidebar disappeared when URL includes .html #933

chenjiahan opened this issue Apr 10, 2024 · 3 comments · Fixed by #982
Labels
🐞 bug Something isn't working

Comments

@chenjiahan
Copy link
Member

Version

"rspress": "^1.17.1"

Details

image

image

Reproduce link

https://github.com/web-infra-dev/rspack/tree/main/website

Reproduce Steps

  1. cd website
  2. pnpm i
  3. pnpm dev
@chenjiahan chenjiahan added the 🐞 bug Something isn't working label Apr 10, 2024
@Timeless0911
Copy link
Collaborator

@sumy7 can you help take a look at this when you have time~

@sumy7
Copy link
Contributor

sumy7 commented Apr 10, 2024

hi @chenjiahan @Timeless0911
I've looked into the issue and found that the problem occurs during the process of normalizing URLs into .html links.
https://github.com/web-infra-dev/rspress/blob/main/packages/shared/src/runtime-utils/index.ts#L245
The titles containing periods are mistakenly interpreted as having file extensions. As a result, the normalized links do not correctly match the data in the sidebar.

@chenjiahan
Copy link
Member Author

I have upgraded to the latest version and the above bug has been fixed 👍

Another bug

However, there is still a similar bug when using cleanUrls: true.

When cleanUrls: true is set, the generated URL will not contains .html suffix. But in some cases, we may still visit the page with .html URLs, and the sidebar will be disappeared:

image

See:

It would be nice if Rspress can compatible with this case

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants