|
|
|
@ -60,7 +60,7 @@ export async function localSearchPlugin(
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function getLocaleForPath(file: string) {
|
|
|
|
|
const relativePath = path.relative(siteConfig.srcDir, file)
|
|
|
|
|
const relativePath = slash(path.relative(siteConfig.srcDir, file))
|
|
|
|
|
const siteData = resolveSiteDataByRoute(siteConfig.site, relativePath)
|
|
|
|
|
return siteData?.localeIndex ?? 'root'
|
|
|
|
|
}
|
|
|
|
@ -97,7 +97,7 @@ export async function localSearchPlugin(
|
|
|
|
|
function getDocId(file: string) {
|
|
|
|
|
let relFile = slash(path.relative(siteConfig.srcDir, file))
|
|
|
|
|
relFile = siteConfig.rewrites.map[relFile] || relFile
|
|
|
|
|
let id = path.join(siteConfig.site.base, relFile)
|
|
|
|
|
let id = slash(path.join(siteConfig.site.base, relFile))
|
|
|
|
|
id = id.replace(/\/index\.md$/, '/')
|
|
|
|
|
id = id.replace(/\.md$/, siteConfig.cleanUrls ? '' : '.html')
|
|
|
|
|
return id
|
|
|
|
|