Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Watch is not effectively utilizing glob patterns #3821

Open
4 tasks done
jinguoguang opened this issue Apr 23, 2024 · 0 comments
Open
4 tasks done

Watch is not effectively utilizing glob patterns #3821

jinguoguang opened this issue Apr 23, 2024 · 0 comments
Labels
bug: pending triage Maybe a bug, waiting for confirmation

Comments

@jinguoguang
Copy link

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

@jinguoguang jinguoguang added the bug: pending triage Maybe a bug, waiting for confirmation label Apr 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug: pending triage Maybe a bug, waiting for confirmation
Projects
None yet
Development

No branches or pull requests

1 participant