Watch is not effectively utilizing glob patterns
jinguoguang opened this issue · comments
king commented
Describe the bug
interface Post{
title: string
date: Date
cover: string | undefined
description: string | undefined
tags: string[] | undefined
categorie: string | undefined
url:string
author: string | undefined
}
declare const data: Post[]
export { data }
export default createContentLoader(['**/*.md','!**/index.md','!nav.md','!archives.md','!posts.md'], {
includeSrc: false,
render: false,
excerpt: false,
transform(raw): Post[] {
console.log("row",raw);
return raw
.map(({url, frontmatter }) => ({
title: frontmatter.title,
cover:frontmatter.cover,
description:frontmatter.description,
tags:frontmatter.tags,
categorie:frontmatter.categorie,
date: frontmatter.date,
url: url,
author: frontmatter.author
}))
}
})
In the above code, I utilize createContentLoader to retrieve information from all *.md files; however, I do not require data from index.md or nav.md files located in any directory. I have employed glob patterns for this purpose, but they seem not to be taking effect. How should I address this issue?
Reproduction
docs
| ---index.md
| ---foo.md
| --- vue
| --- index.md
| --- foo2.md
Expected behavior
docs
| ---foo.md
| --- vue
| --- foo2.md
System Info
vitepress-version: 1.0.2
Additional context
No response
Validations
- Check if you're on the latest VitePress version.
- Follow our Code of Conduct
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.