revert: "fix: createContentLoader generates invalid url when sets `base`" (#2865)

This reverts commit 0f38eb4404.
pull/2876/head
Divyansh Singh 2 years ago committed by GitHub
parent 7295259f30
commit 6be5a7e830
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -99,7 +99,8 @@ The loaded data will be an array with the type of `ContentData[]`:
```ts
interface ContentData {
// mapped absolute URL for the page. e.g. /posts/hello.html
// mapped URL for the page. e.g. /posts/hello.html (does not include base)
// manually iterate or use custom `transform` to normalize the paths
url: string
// frontmatter data of the page
frontmatter: Record<string, any>

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

Loading…
Cancel
Save