diff --git a/packages/react-docs/config/sidebar-routes.js b/packages/react-docs/config/sidebar-routes.js index 3cfdb99e63..72983dde45 100644 --- a/packages/react-docs/config/sidebar-routes.js +++ b/packages/react-docs/config/sidebar-routes.js @@ -43,11 +43,11 @@ export const routes = [ { title: 'Publishing', path: 'contributing/publishing' }, { title: 'React Documentation Site', path: 'contributing/react-documentation-site' }, { - title: React Components PART 1, + title: 'React Components - Part 1', path: 'contributing/react-components-part-1', }, { - title: React Components PART 2, + title: 'React Components - Part 2', path: 'contributing/react-components-part-2', }, ], diff --git a/packages/react-docs/scripts/algolia-search-indexing.js b/packages/react-docs/scripts/algolia-search-indexing.js index 5f53c4787e..6c332f6ae4 100644 --- a/packages/react-docs/scripts/algolia-search-indexing.js +++ b/packages/react-docs/scripts/algolia-search-indexing.js @@ -9,6 +9,8 @@ const ZERO_UUID = '00000000-0000-0000-0000-000000000000'; const stateKey = Symbol('state'); +const isNonEmptyString = (x) => typeof x === 'string' && x.trim().length > 0; + const flatten = (data, options) => { const stack = [...data]; const childrenKey = options?.childrenKey ?? 'children'; @@ -16,7 +18,7 @@ const flatten = (data, options) => { while (stack.length > 0) { const node = stack.shift(); - const { title = '', icon = '', path = '', [stateKey]: state = {} } = node; + const { title = '', path = '', [stateKey]: state = {} } = node; const { level = 0, parent = null } = state; if (node[childrenKey]) { @@ -27,16 +29,15 @@ const flatten = (data, options) => { level: level + 1, parent: { title, - icon, path, }, }, }))); } - if (title && path) { + if (isNonEmptyString(title) && isNonEmptyString(path)) { const object = { - data: { title, icon, path }, + data: { title, path }, level, parent, };