Skip to content

Commit

Permalink
revert: "fix: createContentLoader generates invalid url when sets `ba…
Browse files Browse the repository at this point in the history
…se`" (#2865)

This reverts commit 0f38eb4.
  • Loading branch information
brc-dd committed Aug 28, 2023
1 parent 7295259 commit 6be5a7e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion docs/guide/data-loading.md
Expand Up @@ -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>
Expand Down
2 changes: 1 addition & 1 deletion src/node/contentLoader.ts
Expand Up @@ -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')
Expand Down

0 comments on commit 6be5a7e

Please sign in to comment.