From 5f3167d37ca9abfeb908ed23d62c291f0cd177a2 Mon Sep 17 00:00:00 2001 From: Vlad Moroz Date: Fri, 18 Oct 2024 11:49:43 +0200 Subject: [PATCH 1/2] Remove trailing slash in URLs --- docs/next.config.mjs | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/next.config.mjs b/docs/next.config.mjs index 27cfa7c07..23da324c5 100644 --- a/docs/next.config.mjs +++ b/docs/next.config.mjs @@ -20,6 +20,7 @@ const rootPackage = loadPackageJson(); /** @type {import('next').NextConfig} */ const nextConfig = { + trailingSlash: false, env: { // docs-infra LIB_VERSION: rootPackage.version, From 977039e8779139a2d4b0b236320bb81d9f167c92 Mon Sep 17 00:00:00 2001 From: Vlad Moroz Date: Fri, 18 Oct 2024 13:58:15 +0200 Subject: [PATCH 2/2] Update broken link checks --- docs/data/components/alert-dialog/alert-dialog.mdx | 2 +- docs/data/components/menu/menu.mdx | 2 +- docs/data/getting-started/quick-start/quick-start.mdx | 2 +- docs/scripts/reportBrokenLinks.mts | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/data/components/alert-dialog/alert-dialog.mdx b/docs/data/components/alert-dialog/alert-dialog.mdx index 2f0578fa8..6e21e6277 100644 --- a/docs/data/components/alert-dialog/alert-dialog.mdx +++ b/docs/data/components/alert-dialog/alert-dialog.mdx @@ -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. diff --git a/docs/data/components/menu/menu.mdx b/docs/data/components/menu/menu.mdx index d6187401b..4ecb26442 100644 --- a/docs/data/components/menu/menu.mdx +++ b/docs/data/components/menu/menu.mdx @@ -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 diff --git a/docs/data/getting-started/quick-start/quick-start.mdx b/docs/data/getting-started/quick-start/quick-start.mdx index 8e416b41b..80d089cf7 100644 --- a/docs/data/getting-started/quick-start/quick-start.mdx +++ b/docs/data/getting-started/quick-start/quick-start.mdx @@ -9,7 +9,7 @@ description: Get started with BaseĀ UI, a library of headless ("unstyled") React 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). ## Installation diff --git a/docs/scripts/reportBrokenLinks.mts b/docs/scripts/reportBrokenLinks.mts index a1ba61177..40b632d55 100644 --- a/docs/scripts/reportBrokenLinks.mts +++ b/docs/scripts/reportBrokenLinks.mts @@ -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); @@ -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(