#help with glob pattern

4 messages · Page 1 of 1 (latest)

south pumice
#

This is my folder structure (attached).

And my blog collection inside content.config.ts has this loader:
const blogCollection = defineCollection({ loader: glob({ pattern: '*.{md,mdx}', base: './src/content/blog/*'}),

But I'm getting

The collection "blog" does not exist. Please ensure it is defined in your content config. The collection "blog" does not exist or is empty. Ensure a collection directory with this name exists.

The content.config.ts file is located in src/content.config.ts.

May I get some help? Been stuck with this trying to upgrade to v5 for hours now. It's probably something silly I'm missing...

cloud wedge
#

Hi, I think this should be:

base: 'src/content/blog', pattern: '**/*.{md, mdx}'

south pumice
#

thank you! was trying different variations and didnt realize the /* on base was breaking it.

calm glacierBOT
#
If your issue is resolved, please help by doing the following two steps:
  1. From the ellipses (3-dot menu) in the top-right corner of the post (not the first message), edit the tags to include the Solved tag.
  2. From the same ellipses, select Close Post.
    Your post will still be available to search and can be re-opened simply by replying in it. Closing a post moves it down with older posts, so we can more easily focus on issues that still need to be resolved.
    Thank you for your help!