diff --git a/tools/monorepo-utils/src/md-docs/lib/generate-frontmatter.ts b/tools/monorepo-utils/src/md-docs/lib/generate-frontmatter.ts index 76bb7f81a48..1f0acb2fa9e 100644 --- a/tools/monorepo-utils/src/md-docs/lib/generate-frontmatter.ts +++ b/tools/monorepo-utils/src/md-docs/lib/generate-frontmatter.ts @@ -32,8 +32,8 @@ export const generatePostFrontMatter = ( }, } ); const content = frontMatter.content.split( '\n' ); - const headings = content.filter( ( line ) => '# ' == line.substring( 0, 2 ) ); - const title = ( headings[0]?.substring( 2 ) ?? '' ).trim(); + const headings = content.filter( ( line ) => line.substring( 0, 2 ) === '# ' ); + const title = headings[0]?.substring( 2 ).trim(); frontMatter.data.post_title = frontMatter.data.post_title ?? title; return Object.keys( frontMatter.data ) diff --git a/tools/monorepo-utils/src/md-docs/lib/generate-manifest.ts b/tools/monorepo-utils/src/md-docs/lib/generate-manifest.ts index 9c8a330d5df..4c597109e17 100644 --- a/tools/monorepo-utils/src/md-docs/lib/generate-manifest.ts +++ b/tools/monorepo-utils/src/md-docs/lib/generate-manifest.ts @@ -47,6 +47,7 @@ async function processDirectory( const categoryFolder = path.basename( subDirectory ).split( '-' ); const categoryTitle = categoryFolder .map( ( slugPart ) => slugPart.charAt( 0 ).toUpperCase() + slugPart.slice( 1 ) ); + category.category_slug = categoryFolder; category.category_title = categoryTitle.join( ' ' ); }