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: replaced floating relative URLs with ones affixed to root #378

Merged
merged 2 commits into from
Sep 30, 2023

Conversation

alryaz
Copy link
Contributor

@alryaz alryaz commented May 22, 2023

What it fixes

Fixes navigation issues after opening pages from external websites

Source of the issue

Forward slash character (/) gets appended every time a page is visited on the hacs.xyz website. Therefore clicking URLs with no forward slash in the beginning will cause their target to be appended to the end of the current URL.

Edit: To be clear, this only occurs when the starting URL (https://hacs.xyz/docs/publish/start in the example below) is visited directly due to Javascript code not appending a trailing slash whenever navigation is performed.

Steps to reproduce

  1. Do one of the following:
    • From GitHub:
      1. Navigate to HACS Default GitHub Home Page
      2. Click the first link displayed in the README file (https://hacs.xyz/docs/publish/start)
    • From browser window:
      1. Enter the following URL into the address bar: https://hacs.xyz/docs/publish/start
      2. Press the Enter key
    • From this pull request:
      1. Follow the following URL: https://hacs.xyz/docs/publish/start
  2. Notice how the URL gets rewritten: https://hacs.xyz/docs/publish/start -> https://hacs.xyz/docs/publish/start/
    (a forward slash gets appended)
  3. Click any of the URLs under the General Requirements link (Integration requirements, Plugin requirements, etc.)
  4. Reach a 404: Page not found

alryaz and others added 2 commits May 22, 2023 19:53
fixes navigation issues after opening pages from external websites
@ludeeus ludeeus merged commit 17643f5 into hacs:main Sep 30, 2023
1 check passed
@ludeeus ludeeus mentioned this pull request Sep 30, 2023
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.

2 participants