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(docs): Better trailing slash omission #23304

Merged
merged 6 commits into from
Dec 11, 2024

Conversation

Josmithr
Copy link
Contributor

@Josmithr Josmithr commented Dec 11, 2024

Partial reversion of #23286.

SWA's implementation of "trailingSlash": "never" is currently flawed. The resulting redirect ends up exposing the underlying SWA URL of the site, rather than our configured front door URL. E.g. https://fluidframework.com/docs/concepts/signals/ ends up redirecting to https://salmon-sand-0b7fa7c1e.1.azurestaticapps.net/docs/concepts/signals.

This PR removes that configuration flag, and instead leverages Docusaurus's trailingSlash configuration option to not emit trailing slashes.

This required updating a handful of relative URL links to use file path links. The guidance documentation in the README has been updated to offer new guidance around relative links in light of new learnings.

AB#25895

@Josmithr Josmithr requested a review from a team December 11, 2024 22:38
Copy link
Contributor

@alexvy86 alexvy86 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good thing you caught it :)

Copy link
Contributor

🔗 No broken links found! ✅

Your attention to detail is admirable.

linkcheck output


> fluid-framework-docs-site@0.0.0 ci:check-links /home/runner/work/FluidFramework/FluidFramework/docs
> start-server-and-test "npm run serve -- --no-open" 3000 check-links

1: starting server using command "npm run serve -- --no-open"
and when url "[ 'http://127.0.0.1:3000' ]" is responding with HTTP status code 200
running tests using command "npm run check-links"


> fluid-framework-docs-site@0.0.0 serve
> docusaurus serve --no-open

[SUCCESS] Serving "build" directory at: http://localhost:3000/

> fluid-framework-docs-site@0.0.0 check-links
> linkcheck http://localhost:3000 --skip-file skipped-urls.txt

Crawling...

Stats:
  170098 links
    1596 destination URLs
    1825 URLs ignored
       0 warnings
       0 errors


@Josmithr Josmithr enabled auto-merge (squash) December 11, 2024 22:58
@Josmithr Josmithr merged commit e57422e into microsoft:main Dec 11, 2024
33 checks passed
@Josmithr Josmithr deleted the docs/different-trailing-slash-fix branch December 11, 2024 22:58
@Josmithr Josmithr mentioned this pull request Dec 12, 2024
Josmithr added a commit that referenced this pull request Dec 12, 2024
Somehow, a formatting issue escaped our PR validation in #23304. This PR
runs Biome to format that file.
Josmithr added a commit to Josmithr/FluidFramework that referenced this pull request Dec 12, 2024
Partial reversion of microsoft#23286.

SWA's implementation of `"trailingSlash": "never"` is currently flawed.
The resulting redirect ends up exposing the underlying SWA URL of the
site, rather than our configured front door URL. E.g.
`https://fluidframework.com/docs/concepts/signals/` ends up redirecting
to
`https://salmon-sand-0b7fa7c1e.1.azurestaticapps.net/docs/concepts/signals`.
- See Azure/static-web-apps#1036

This PR removes that configuration flag, and instead leverages
Docusaurus's
[trailingSlash](https://docusaurus.io/docs/api/docusaurus-config#trailingSlash)
configuration option to not emit trailing slashes.

This required updating a handful of relative URL links to use file path
links. The guidance documentation in the README has been updated to
offer new guidance around relative links in light of new learnings.

[AB#25895](https://dev.azure.com/fluidframework/235294da-091d-4c29-84fc-cdfc3d90890b/_workitems/edit/25895)
Josmithr added a commit to Josmithr/FluidFramework that referenced this pull request Dec 12, 2024
Somehow, a formatting issue escaped our PR validation in microsoft#23304. This PR
runs Biome to format that file.
Josmithr added a commit that referenced this pull request Dec 12, 2024
Reverts a change made in #23304, which ultimately results in the
unwanted redirects resulting from the following SWA bug:
<Azure/static-web-apps#1036>.
Josmithr added a commit to Josmithr/FluidFramework that referenced this pull request Dec 12, 2024
Partial reversion of microsoft#23286.

SWA's implementation of `"trailingSlash": "never"` is currently flawed.
The resulting redirect ends up exposing the underlying SWA URL of the
site, rather than our configured front door URL. E.g.
`https://fluidframework.com/docs/concepts/signals/` ends up redirecting
to
`https://salmon-sand-0b7fa7c1e.1.azurestaticapps.net/docs/concepts/signals`.
- See Azure/static-web-apps#1036

This PR removes that configuration flag, and instead leverages
Docusaurus's
[trailingSlash](https://docusaurus.io/docs/api/docusaurus-config#trailingSlash)
configuration option to not emit trailing slashes.

This required updating a handful of relative URL links to use file path
links. The guidance documentation in the README has been updated to
offer new guidance around relative links in light of new learnings.

[AB#25895](https://dev.azure.com/fluidframework/235294da-091d-4c29-84fc-cdfc3d90890b/_workitems/edit/25895)
Josmithr added a commit to Josmithr/FluidFramework that referenced this pull request Dec 12, 2024
Somehow, a formatting issue escaped our PR validation in microsoft#23304. This PR
runs Biome to format that file.
Josmithr added a commit to Josmithr/FluidFramework that referenced this pull request Dec 12, 2024
Reverts a change made in microsoft#23304, which ultimately results in the
unwanted redirects resulting from the following SWA bug:
<Azure/static-web-apps#1036>.
Josmithr added a commit to Josmithr/FluidFramework that referenced this pull request Dec 12, 2024
Partial reversion of microsoft#23286.

SWA's implementation of `"trailingSlash": "never"` is currently flawed.
The resulting redirect ends up exposing the underlying SWA URL of the
site, rather than our configured front door URL. E.g.
`https://fluidframework.com/docs/concepts/signals/` ends up redirecting
to
`https://salmon-sand-0b7fa7c1e.1.azurestaticapps.net/docs/concepts/signals`.
- See Azure/static-web-apps#1036

This PR removes that configuration flag, and instead leverages
Docusaurus's
[trailingSlash](https://docusaurus.io/docs/api/docusaurus-config#trailingSlash)
configuration option to not emit trailing slashes.

This required updating a handful of relative URL links to use file path
links. The guidance documentation in the README has been updated to
offer new guidance around relative links in light of new learnings.

[AB#25895](https://dev.azure.com/fluidframework/235294da-091d-4c29-84fc-cdfc3d90890b/_workitems/edit/25895)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants