File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -86,7 +86,7 @@ function generatePath(content: string): string[] | undefined {
86
86
return plural ;
87
87
}
88
88
89
- function generateSlug ( content : string ) : string [ ] {
89
+ function extractSlug ( content : string ) : string [ ] {
90
90
const match = content . match ( / s l u g : \s * [ " ' ] ? ( [ ^ " ' \n ] + ) [ " ' ] ? / ) ! ;
91
91
const url = match [ 1 ] . split ( ":" ) . pop ( ) ! ;
92
92
const normalized = url . endsWith ( "_static" ) ? url . slice ( 0 , - 7 ) : url ;
@@ -135,7 +135,7 @@ export async function generateDescriptions(): Promise<{
135
135
await Promise . all (
136
136
indexPaths . map ( async ( fileURL ) => {
137
137
const content = await fs . readFile ( fileURL , "utf-8" ) ;
138
- const slug = generateSlug ( content ) ;
138
+ const slug = extractSlug ( content ) ;
139
139
const generatedPatch = generatePath ( content ) ;
140
140
if ( ! slug || slug . length === 0 || ! generatedPatch ) return ;
141
141
You can’t perform that action at this time.
0 commit comments