fix(search): remove extra /index from routes

pull/2229/head
Divyansh Singh 2 years ago
parent 7dfe9d2d43
commit 9e04b43567

@ -98,6 +98,7 @@ export async function localSearchPlugin(
let relFile = path.relative(siteConfig.srcDir, file) let relFile = path.relative(siteConfig.srcDir, file)
relFile = siteConfig.rewrites.map[relFile] || relFile relFile = siteConfig.rewrites.map[relFile] || relFile
let id = path.join(siteConfig.site.base, relFile) let id = path.join(siteConfig.site.base, relFile)
id = id.replace(/\/index\.md$/, '/')
id = id.replace(/\.md$/, siteConfig.cleanUrls ? '' : '.html') id = id.replace(/\.md$/, siteConfig.cleanUrls ? '' : '.html')
return id return id
} }

Loading…
Cancel
Save