File tree 2 files changed +17
-2
lines changed
src/runtime/server/transformers 2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -82,6 +82,7 @@ export function refineUrlPart (name: string): string {
82
82
if ( SEMVER_REGEX . test ( name ) ) {
83
83
return name
84
84
}
85
+
85
86
return (
86
87
name
87
88
/**
@@ -91,10 +92,10 @@ export function refineUrlPart (name: string): string {
91
92
/**
92
93
* Remove index keyword
93
94
*/
94
- . replace ( / ^ i n d e x / , '' )
95
+ . replace ( / ^ i n d e x ( \. d r a f t ) ? $ / , '' )
95
96
/**
96
97
* Remove draft keyword
97
98
*/
98
- . replace ( / \. d r a f t / , '' )
99
+ . replace ( / \. d r a f t $ / , '' )
99
100
)
100
101
}
Original file line number Diff line number Diff line change @@ -53,6 +53,20 @@ const testCases = {
53
53
_draft : false ,
54
54
_partial : false ,
55
55
_path : '/one/fileparamvaluehash'
56
+ } ,
57
+ 'content:indexer.md' : {
58
+ __description : 'non-index file with index substring' ,
59
+ title : 'Indexer' ,
60
+ _draft : false ,
61
+ _partial : false ,
62
+ _path : '/indexer'
63
+ } ,
64
+ 'content:indexer.draft.md' : {
65
+ __description : 'non-index file with index substring' ,
66
+ title : 'Indexer' ,
67
+ _draft : true ,
68
+ _partial : false ,
69
+ _path : '/indexer'
56
70
}
57
71
}
58
72
You can’t perform that action at this time.
0 commit comments