<#10159 docs: Disable path trailing slashes entire...
# meltano-repo-activity
g
#10159 docs: Disable path trailing slashes entirely Pull request opened by ReubenFrankel Description Relative in-page links resolved incorrectly on first page load. For example, on
/reference/cloud/api/resources/accounts
, the See Also link
[…](profiles#set-the-working-account-for-a-profile)
navigated to
.../accounts/profiles#…
instead of the sibling
.../profiles#…
. Reaching the same page via in-app (SPA) navigation resolved it correctly, so it was a confusing first-load-only issue. Root cause: Docusaurus's default config emits directory-index files (
accounts/index.html
), which Netlify's "Pretty URLs" canonicalizes to the trailing-slash form (
/…/accounts/
). On first load the browser location therefore carries a trailing slash, and React Router resolves relative link clicks against it, yielding
accounts/profiles
. In-app navigation uses the slashless route, hence the discrepancy. Fix: set
trailingSlash: false
. Docusaurus then emits flat files (
accounts.html
), which Netlify Pretty URLs canonicalizes to the slashless form (
/…/accounts
). First-load locations are now slashless and match in-app navigation, so relative links resolve consistently — at the source, with no client-side workaround. Verification Live examples on this PR's deploy preview: Try the original bug: open `/reference/cloud/api/resources/accounts` and click the See Also → "Set the working account for a profile" link; it now lands on
/reference/cloud/api/resources/profiles#set-the-working-account-for-a-profile
. Trailing-slash canonicalization — legacy
/…/
URLs redirect cleanly (no 404s): | Request | Result | | ------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------- | | [/reference/cloud/api/resources/accounts](https://deploy-preview-10159--docs-meltano.netlify.app/reference/cloud/api/resources/accounts) | 200 | | [/reference/cloud/api/resources/accounts/](https://deploy-preview-10159--docs-meltano.netlify.app/reference/cloud/api/resources/accounts/) | 301 → /reference/cloud/api/resources/accounts | | [/reference/cloud/api/resources/profiles/](https://deploy-preview-10159--docs-meltano.netlify.app/reference/cloud/api/resources/profiles/) | 301 → /reference/cloud/api/resources/profiles |
netlify.toml
redirect rules still fire
— including those whose
from
ends in `/`: | Request | Result | | -------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------- | | [/tutorials/creating-workspaces/](https://deploy-preview-10159--docs-meltano.netlify.app/tutorials/creating-workspaces/) | 301 → /meltano-cloud/creating-workspace | | [/docs/how-to-guides/manage-workspaces/](https://deploy-preview-10159--docs-meltano.netlify.app/docs/how-to-guides/manage-workspaces/) | 301 → /meltano-cloud/managing-a-workspace | | [/docs/how-to-guides/transform-data](https://deploy-preview-10159--docs-meltano.netlify.app/docs/how-to-guides/transform-data) | 301 → /meltano-cloud/transform-data | | [/docs/how-to-guides/anything-else](https://deploy-preview-10159--docs-meltano.netlify.app/docs/how-to-guides/anything-else) | 301 → /meltano-cloud/cloud-overview (wildcard) | | [/cloud/foo](https://deploy-preview-10159--docs-meltano.netlify.app/cloud/foo) | 301 → https://docs.arch.dev/ | | [/getting-started/installation](https://deploy-preview-10159--docs-meltano.netlify.app/getting-started/installation) | 301 → https://docs.meltano.com/meltano-open/meltano-at-a-glance | Notes • Canonical URLs across the site change from
/foo/
to `/foo`; the `301`s above preserve link equity for existing inbound links and search-engine indexes. •
trailingSlash
and Netlify's "Pretty URLs" setting interact (the flat-file output relies on Pretty URLs to serve clean URLs and redirect the legacy
/foo/
form). This config was validated as a pair — if the Netlify "Pretty URLs" setting is changed, re-test. Checklist • I have read the contribution guide Was generative AI tooling used to co-author this PR? • Yes (please specify the tool below) Generated-by: Claude Code following the agentic coding guidelines Related Issues • #10157 • #10158 meltano/meltano