File tree Expand file tree Collapse file tree 2 files changed +17
-2
lines changed
src/runtime/server/transformers Expand file tree Collapse file tree 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 {
8282 if ( SEMVER_REGEX . test ( name ) ) {
8383 return name
8484 }
85+
8586 return (
8687 name
8788 /**
@@ -91,10 +92,10 @@ export function refineUrlPart (name: string): string {
9192 /**
9293 * Remove index keyword
9394 */
94- . replace ( / ^ i n d e x / , '' )
95+ . replace ( / ^ i n d e x ( \. d r a f t ) ? $ / , '' )
9596 /**
9697 * Remove draft keyword
9798 */
98- . replace ( / \. d r a f t / , '' )
99+ . replace ( / \. d r a f t $ / , '' )
99100 )
100101}
Original file line number Diff line number Diff line change @@ -53,6 +53,20 @@ const testCases = {
5353 _draft : false ,
5454 _partial : false ,
5555 _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'
5670 }
5771}
5872
You can’t perform that action at this time.
0 commit comments