File tree Expand file tree Collapse file tree 1 file changed +11
-8
lines changed
Expand file tree Collapse file tree 1 file changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ const processMdxEntry = ({ children: [entry] }) => {
1717 fileAbsolutePath,
1818 mdxAST,
1919 objectID,
20- frontmatter : { title, redirect } ,
20+ frontmatter : { title, redirect, slug : customSlug } ,
2121 } = entry ;
2222 if ( redirect ) {
2323 // avoid pushing empty records
@@ -41,13 +41,15 @@ const processMdxEntry = ({ children: [entry] }) => {
4141 . slice ( 0 , - 1 )
4242 . join ( '/' ) ;
4343 const path = `/${ cutStrippedDirectory } /${ title . replace ( / \/ / g, '-' ) } ` ;
44- const slug = compose (
45- noTrailingSlash ,
46- dedupePath ,
47- removeGuidesAndRedirectWelcome ,
48- unorderify ,
49- slugify ,
50- ) ( path ) ;
44+ const slug =
45+ customSlug ||
46+ compose (
47+ noTrailingSlash ,
48+ dedupePath ,
49+ removeGuidesAndRedirectWelcome ,
50+ unorderify ,
51+ slugify ,
52+ ) ( path ) ;
5153 const chunks = chunk ( mdxAstToPlainText ( mdxAST ) , 300 ) ;
5254 let pointer = chunks . length ;
5355 const cache = new Array ( pointer ) ;
@@ -86,6 +88,7 @@ const docPagesQuery = `{
8688 frontmatter {
8789 title
8890 redirect
91+ slug
8992 }
9093 mdxAST
9194 fileAbsolutePath
You can’t perform that action at this time.
0 commit comments