diff --git a/scripts/generateSidebars.js b/scripts/generateSidebars.js index 8e8999b11..089f3c9af 100644 --- a/scripts/generateSidebars.js +++ b/scripts/generateSidebars.js @@ -14,7 +14,7 @@ const fs = require('fs'); const path = require('path'); -const { shouldExcludeFromBuild } = require('../src/docConfig'); +const { docs: registry, shouldExcludeFromBuild } = require('../src/docConfig'); const DOCS_DIR = path.join(__dirname, '..', 'docs'); const SIDEBAR_PATH = path.join(__dirname, '..', 'sidebars.js'); @@ -576,7 +576,7 @@ function generateSidebars() { const versionFormatted = version.replace(/\./g, '_'); const sidebarKey = `${groupCamel}${folderCamel}_${versionFormatted}`; - const documentName = titleCase(folderName); + const documentName = registry.find((d) => d.doc_location === docPath)?.sidebar_label || titleCase(folderName); // Only create if not already present if (!sidebarContent[sidebarKey]) { diff --git a/src/docConfig.js b/src/docConfig.js index 94aa4cf81..3aa150ad4 100644 --- a/src/docConfig.js +++ b/src/docConfig.js @@ -26,6 +26,10 @@ * with watermark, fully searchable) or inactive+draft (unpublished, no * watermark visible because the doc isn't on the prod site). * + * Sidebar label (optional): `sidebar_label` sets the document's name in its sidebar + * and breadcrumbs. Without it, the name is the title-cased folder name, which is + * wrong for folders that abbreviate (e.g. "cle-freezing-screening" → "Cle …"). + * * Download-only entries (downloadUrl, no doc_location) are tiles that link * directly to a PDF — they have no associated MDX folder and are unaffected * by the active/draft build-inclusion logic.