-
Notifications
You must be signed in to change notification settings - Fork 535
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): Configure SWA to never emit trailing slashes for website URLs #23286
Conversation
@@ -40,7 +40,7 @@ | |||
"prettier:fix": "prettier --write . --cache --ignore-path ../.prettierignore", | |||
"rebuild": "npm run clean && npm run build", | |||
"serve": "docusaurus serve", | |||
"serve-with-azure-emulation": "swa start", | |||
"serve-with-azure-emulation": "swa start --config-name ff-doc-site", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unclear from the CLI docs what the policy is for a config file with only a single "configuration" entry, but this makes things more explicit.
@@ -14,5 +14,6 @@ | |||
"route": "/404", | |||
"statusCode": 404 | |||
} | |||
] | |||
], | |||
"trailingSlash": "never" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The crux of the "fix" - configures SWA to never emit a trailing slash in URLs.
🔗 No broken links found! ✅ Your attention to detail is admirable. linkcheck output
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
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`. - 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)
…RLs (microsoft#23286) Ensures consistent relative file path link behavior by ensuring resolved site URLs never include a trailing slash. See <https://learn.microsoft.com/en-us/azure/static-web-apps/configuration#never> Also makes some small fixes to config files for local development. [AB#25895](https://dev.azure.com/fluidframework/235294da-091d-4c29-84fc-cdfc3d90890b/_workitems/edit/25895)
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)
…RLs (microsoft#23286) Ensures consistent relative file path link behavior by ensuring resolved site URLs never include a trailing slash. See <https://learn.microsoft.com/en-us/azure/static-web-apps/configuration#never> Also makes some small fixes to config files for local development. [AB#25895](https://dev.azure.com/fluidframework/235294da-091d-4c29-84fc-cdfc3d90890b/_workitems/edit/25895)
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)
…RLs (microsoft#23286) Ensures consistent relative file path link behavior by ensuring resolved site URLs never include a trailing slash. See <https://learn.microsoft.com/en-us/azure/static-web-apps/configuration#never> Also makes some small fixes to config files for local development. [AB#25895](https://dev.azure.com/fluidframework/235294da-091d-4c29-84fc-cdfc3d90890b/_workitems/edit/25895)
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)
Ensures consistent relative file path link behavior by ensuring resolved site URLs never include a trailing slash. See https://learn.microsoft.com/en-us/azure/static-web-apps/configuration#never
Also makes some small fixes to config files for local development.
AB#25895