diff --git a/patches/@signalwire__docusaurus-plugin-llms-txt@1.2.2.patch b/patches/@signalwire__docusaurus-plugin-llms-txt@1.2.2.patch new file mode 100644 index 000000000..64df84eac --- /dev/null +++ b/patches/@signalwire__docusaurus-plugin-llms-txt@1.2.2.patch @@ -0,0 +1,37 @@ +diff --git a/lib/utils/url.js b/lib/utils/url.js +index 0c3168c9128b6abd1a0860b222872b2332dc5ab8..303ac39b92e24c9008924c949ecf91c6746c38cc 100644 +--- a/lib/utils/url.js ++++ b/lib/utils/url.js +@@ -56,19 +56,31 @@ export function stripBaseUrl(routePath, baseUrl) { + */ + export function formatUrl(routePath, options, baseUrl = '') { + const { enableMarkdownFiles = true, relativePaths = true, markdownFile, } = options; ++ // routePath and markdownFile may already carry the Docusaurus baseUrl. Strip it, or the ++ // section prefix lands in the URL twice. Stripping before the .md suffix is what keeps a ++ // route that is the site root on the INDEX_MD branch instead of producing '/.md'. ++ const sitePath = relativePaths === false && baseUrl ++ ? (baseUrl.replace(/^[a-z][a-z0-9+.-]*:\/\/[^/]*/i, '') || '/') ++ : null; + // Ensure route path starts with / + let targetPath = ensureLeadingSlash(routePath); ++ if (sitePath) { ++ targetPath = stripBaseUrl(targetPath, sitePath); ++ } + // Use markdown file path if available and enabled + if (enableMarkdownFiles && markdownFile) { + // Ensure markdown file path starts with / for consistency + targetPath = ensureLeadingSlash(markdownFile); ++ if (sitePath) { ++ targetPath = stripBaseUrl(targetPath, sitePath); ++ } + } + else if (enableMarkdownFiles) { + // Add .md extension to route path + targetPath = targetPath === '/' ? INDEX_MD : `${targetPath}.md`; + } + // Handle absolute vs relative paths +- if (relativePaths === false && baseUrl) { ++ if (sitePath) { + return normalizeUrl([baseUrl, targetPath]); + } + // For relative paths, ensure we preserve the leading slash diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index aa8dc3f64..2f1cc0766 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -203,6 +203,9 @@ settings: autoInstallPeers: true excludeLinksFromLockfile: false +patchedDependencies: + '@signalwire/docusaurus-plugin-llms-txt@1.2.2': 7a2223d63ec437e823d7f72d8326cd8c35de63bdff98622db171192f9ad2f6ee + importers: .: @@ -447,7 +450,7 @@ importers: version: 3.10.2(@algolia/client-search@5.59.0)(@docusaurus/faster@3.10.2(@docusaurus/types@3.10.2(@swc/core@1.16.2)(esbuild@0.28.2)(postcss@8.5.28)(react-dom@19.3.0(react@19.3.0))(react@19.3.0))(esbuild@0.28.2)(postcss@8.5.28))(@mdx-js/react@3.1.1(@types/react@19.3.0)(react@19.3.0))(@rspack/core@1.7.12)(@swc/core@1.16.2)(@types/react@19.3.0)(esbuild@0.28.2)(postcss@8.5.28)(react-dom@19.3.0(react@19.3.0))(react@19.3.0)(search-insights@2.17.3)(typescript@7.0.2) '@signalwire/docusaurus-plugin-llms-txt': specifier: ^1.2.2 - version: 1.2.2(@docusaurus/core@3.10.2(@docusaurus/faster@3.10.2(@docusaurus/types@3.10.2(@swc/core@1.16.2)(esbuild@0.28.2)(postcss@8.5.28)(react-dom@19.3.0(react@19.3.0))(react@19.3.0))(esbuild@0.28.2)(postcss@8.5.28))(@mdx-js/react@3.1.1(@types/react@19.3.0)(react@19.3.0))(@rspack/core@1.7.12)(@swc/core@1.16.2)(@swc/html@1.16.2)(csso@5.0.5)(esbuild@0.28.2)(lightningcss@1.33.0)(postcss@8.5.28)(react-dom@19.3.0(react@19.3.0))(react@19.3.0)(typescript@7.0.2)(uglify-js@3.19.3)) + version: 1.2.2(patch_hash=7a2223d63ec437e823d7f72d8326cd8c35de63bdff98622db171192f9ad2f6ee)(@docusaurus/core@3.10.2(@docusaurus/faster@3.10.2(@docusaurus/types@3.10.2(@swc/core@1.16.2)(esbuild@0.28.2)(postcss@8.5.28)(react-dom@19.3.0(react@19.3.0))(react@19.3.0))(esbuild@0.28.2)(postcss@8.5.28))(@mdx-js/react@3.1.1(@types/react@19.3.0)(react@19.3.0))(@rspack/core@1.7.12)(@swc/core@1.16.2)(@swc/html@1.16.2)(csso@5.0.5)(esbuild@0.28.2)(lightningcss@1.33.0)(postcss@8.5.28)(react-dom@19.3.0(react@19.3.0))(react@19.3.0)(typescript@7.0.2)(uglify-js@3.19.3)) clsx: specifier: ^2.1.1 version: 2.1.1 @@ -13755,7 +13758,7 @@ snapshots: '@sideway/pinpoint@2.0.0': {} - '@signalwire/docusaurus-plugin-llms-txt@1.2.2(@docusaurus/core@3.10.2(@docusaurus/faster@3.10.2(@docusaurus/types@3.10.2(@swc/core@1.16.2)(esbuild@0.28.2)(postcss@8.5.28)(react-dom@19.3.0(react@19.3.0))(react@19.3.0))(esbuild@0.28.2)(postcss@8.5.28))(@mdx-js/react@3.1.1(@types/react@19.3.0)(react@19.3.0))(@rspack/core@1.7.12)(@swc/core@1.16.2)(@swc/html@1.16.2)(csso@5.0.5)(esbuild@0.28.2)(lightningcss@1.33.0)(postcss@8.5.28)(react-dom@19.3.0(react@19.3.0))(react@19.3.0)(typescript@7.0.2)(uglify-js@3.19.3))': + '@signalwire/docusaurus-plugin-llms-txt@1.2.2(patch_hash=7a2223d63ec437e823d7f72d8326cd8c35de63bdff98622db171192f9ad2f6ee)(@docusaurus/core@3.10.2(@docusaurus/faster@3.10.2(@docusaurus/types@3.10.2(@swc/core@1.16.2)(esbuild@0.28.2)(postcss@8.5.28)(react-dom@19.3.0(react@19.3.0))(react@19.3.0))(esbuild@0.28.2)(postcss@8.5.28))(@mdx-js/react@3.1.1(@types/react@19.3.0)(react@19.3.0))(@rspack/core@1.7.12)(@swc/core@1.16.2)(@swc/html@1.16.2)(csso@5.0.5)(esbuild@0.28.2)(lightningcss@1.33.0)(postcss@8.5.28)(react-dom@19.3.0(react@19.3.0))(react@19.3.0)(typescript@7.0.2)(uglify-js@3.19.3))': dependencies: '@docusaurus/core': 3.10.2(@docusaurus/faster@3.10.2(@docusaurus/types@3.10.2(@swc/core@1.16.2)(esbuild@0.28.2)(postcss@8.5.28)(react-dom@19.3.0(react@19.3.0))(react@19.3.0))(esbuild@0.28.2)(postcss@8.5.28))(@mdx-js/react@3.1.1(@types/react@19.3.0)(react@19.3.0))(@rspack/core@1.7.12)(@swc/core@1.16.2)(@swc/html@1.16.2)(csso@5.0.5)(esbuild@0.28.2)(lightningcss@1.33.0)(postcss@8.5.28)(react-dom@19.3.0(react@19.3.0))(react@19.3.0)(typescript@7.0.2)(uglify-js@3.19.3) fs-extra: 11.4.1 diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index e69574e3a..833a917c1 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -41,3 +41,6 @@ supportedArchitectures: nodeLinker: hoisted publicHoistPattern: - "*" + +patchedDependencies: + '@signalwire/docusaurus-plugin-llms-txt@1.2.2': patches/@signalwire__docusaurus-plugin-llms-txt@1.2.2.patch diff --git a/website/docusaurus.config.js b/website/docusaurus.config.js index 333af4240..425149333 100644 --- a/website/docusaurus.config.js +++ b/website/docusaurus.config.js @@ -117,6 +117,9 @@ module.exports = { includeGeneratedIndex: false, includePages: true, relativePaths: false, + excludeRoutes: [ + '/cli/', + ], }, }, ],