File tree 4 files changed +6
-7
lines changed
client/theme-default/composables
4 files changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ function normalizeLink(
43
43
? link . replace ( / \/ $ / , '' ) +
44
44
ensureStartingSlash (
45
45
path
46
- . replace ( / ( ^ | \/ ) ? i n d e x .m d $ / , '$1' )
46
+ . replace ( / ( ^ | \/ ) i n d e x \ .m d $ / , '$1' )
47
47
. replace ( / \. m d $ / , addExt ? '.html' : '' )
48
48
)
49
49
: link
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ export async function generateSitemap(siteConfig: SiteConfig) {
19
19
siteConfig . pages . map ( async ( page ) => {
20
20
//
21
21
let url = siteConfig . rewrites . map [ page ] || page
22
- url = url . replace ( / ( ^ | \/ ) ? i n d e x .m d $ / , '$1' )
22
+ url = url . replace ( / ( ^ | \/ ) i n d e x \ .m d $ / , '$1' )
23
23
url = url . replace ( / \. m d $ / , siteConfig . cleanUrls ? '' : '.html' )
24
24
25
25
const lastmod = siteConfig . lastUpdated && ( await getGitTimestamp ( page ) )
Original file line number Diff line number Diff line change @@ -141,10 +141,9 @@ export function createContentLoader<T = ContentData[]>(
141
141
)
142
142
const url =
143
143
'/' +
144
- normalizePath ( path . relative ( config . srcDir , file ) ) . replace (
145
- / \. m d $ / ,
146
- config . cleanUrls ? '' : '.html'
147
- )
144
+ normalizePath ( path . relative ( config . srcDir , file ) )
145
+ . replace ( / ( ^ | \/ ) i n d e x \. m d $ / , '$1' )
146
+ . replace ( / \. m d $ / , config . cleanUrls ? '' : '.html' )
148
147
const html = render ? md . render ( src ) : undefined
149
148
const renderedExcerpt = renderExcerpt
150
149
? excerpt && md . render ( excerpt )
Original file line number Diff line number Diff line change @@ -119,7 +119,7 @@ export async function localSearchPlugin(
119
119
let relFile = slash ( path . relative ( siteConfig . srcDir , file ) )
120
120
relFile = siteConfig . rewrites . map [ relFile ] || relFile
121
121
let id = slash ( path . join ( siteConfig . site . base , relFile ) )
122
- id = id . replace ( / \/ i n d e x \. m d $ / , '/ ' )
122
+ id = id . replace ( / ( ^ | \/ ) i n d e x \. m d $ / , '$1 ' )
123
123
id = id . replace ( / \. m d $ / , siteConfig . cleanUrls ? '' : '.html' )
124
124
return id
125
125
}
You can’t perform that action at this time.
0 commit comments