Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions website/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,7 @@ module.exports = {
includePages: true,
relativePaths: false,
excludeRoutes: [
'/sdk/python/',
'/sdk/python/reference/[0-9]*/**',
'/sdk/python/reference/[0-9]*',
'/sdk/python/reference/next/**',
Expand Down
Original file line number Diff line number Diff line change
@@ -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
7 changes: 5 additions & 2 deletions website/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions website/pnpm-workspace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ allowBuilds:
'@swc/core': true
core-js: false
unrs-resolver: true
patchedDependencies:
'@signalwire/docusaurus-plugin-llms-txt@1.2.2': patches/@signalwire__docusaurus-plugin-llms-txt@1.2.2.patch
Loading