Skip to content

Commit

Permalink
[docs] Remove trailing slash from the URLs (mui#748)
Browse files Browse the repository at this point in the history
  • Loading branch information
vladmoroz authored and atomiks committed Oct 30, 2024
1 parent f2390f4 commit 3e440d3
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion docs/data/components/alert-dialog/alert-dialog.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Alert Dialogs are implemented using a collection of related components:

## Alert dialogs vs. dialogs

The Alert Dialog is in many ways similar to the [Dialog](/components/react-dialog/) component.
The Alert Dialog is in many ways similar to the [Dialog](/components/react-dialog) component.
Alert dialogs should be used in cases where the normal user's workflow needs to be interrupted to get a response.
Therefore alert dialogs are always modal and cannot be dismissed any other way than by pressing a button inside them.

Expand Down
2 changes: 1 addition & 1 deletion docs/data/components/menu/menu.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ To visually separate items, use the `Menu.Separator` component:
```

The Menu.Separator is a re-exported Separator component.
See the [Separator docs](/components/react-separator/) to learn about its API.
See the [Separator docs](/components/react-separator) to learn about its API.

## Animations

Expand Down
2 changes: 1 addition & 1 deletion docs/data/getting-started/quick-start/quick-start.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ description: Get started with Base UI, a library of headless ("unstyled") React

<Callout type="info">
If you're using Next.js 13.4 or later, check out the [Next.js App Router
guide](/guides/next-js-app-router/).
guide](/guides/next-js-app-router).
</Callout>

## Installation
Expand Down
1 change: 1 addition & 0 deletions docs/next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const rootPackage = loadPackageJson();

/** @type {import('next').NextConfig} */
const nextConfig = {
trailingSlash: false,
env: {
// docs-infra
LIB_VERSION: rootPackage.version,
Expand Down
6 changes: 3 additions & 3 deletions docs/scripts/reportBrokenLinks.mts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ async function processMarkdownPage(filePath: string) {
}
}

function pagePathToUrl(pagePath: string): string | null {
function pagePathToUrl(pagePath: string, trailingSlash = false): string | null {
// data/($1)/($2)/*.mdx
const parts = /^data\/([^/]*)\/([^/]*)\/[^/]*.mdx?$/.exec(pagePath);

Expand All @@ -88,10 +88,10 @@ function pagePathToUrl(pagePath: string): string | null {
}

if (parts[1] === 'components') {
return `/components/react-${parts[2]}/`;
return `/components/react-${parts[2]}${trailingSlash ? '/' : ''}`;
}

return `/${parts[1]}/${parts[2]}/`;
return `/${parts[1]}/${parts[2]}${trailingSlash ? '/' : ''}`;
}

async function getLinksAndAnchors(
Expand Down

0 comments on commit 3e440d3

Please sign in to comment.