fix: `createContentLoader` generates invalid url when `base` is set (#2714)

pull/2721/head
烽宁 2 years ago committed by GitHub
parent 7778187f2d
commit 0f38eb4404
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -140,7 +140,7 @@ export function createContentLoader<T = ContentData[]>(
: { excerpt: renderExcerpt } : { excerpt: renderExcerpt }
) )
const url = const url =
'/' + config.site.base +
normalizePath(path.relative(config.srcDir, file)) normalizePath(path.relative(config.srcDir, file))
.replace(/(^|\/)index\.md$/, '$1') .replace(/(^|\/)index\.md$/, '$1')
.replace(/\.md$/, config.cleanUrls ? '' : '.html') .replace(/\.md$/, config.cleanUrls ? '' : '.html')

Loading…
Cancel
Save