Skip to content

Commit 1b53fe8

Browse files
committed
docs: excluding dot files from collection
resolves #3090
1 parent 41e442e commit 1b53fe8

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

docs/content/docs/1.getting-started/4.migration.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ The new API is backed by SQL and content queries happens within a specific colle
4545
- There is no source option in module options, instead you can define [multiple sources](/docs/collections/sources) for your collections in `content.config.ts`.
4646
- Document `._path` is now renamed to `.path`, likewise all internal fields with `_` prefix are removed or renamed.
4747
- `useContentHelpers()` is removed
48+
- Module does not ignore dot files by default, you can ignore them by adding `ignore: ['**/.*']` in `exclude` options of your collection source.
4849

4950
### Nuxt Studio integration
5051

@@ -162,3 +163,30 @@ a way that includes these files. For example `source: '**'` and `source: '**/*.{
162163
in collection, but `source: '**/*.md'` will not include them.
163164

164165

166+
## Ignore dot files
167+
168+
By default, Content v3 does not ignore dot files. If you want to ignore them, you can add `ignore: ['**/.*']` in the `exclude` option of your collection source.
169+
170+
```ts
171+
defineCollection({
172+
source: {
173+
include: '**',
174+
exclude: ['**/.*']
175+
}
176+
})
177+
```
178+
179+
Note that the above pattern will also excldue `.navigation.yml` file from collection. If you use `.navigation.yml` and want to keep them
180+
you can use `**/.(!(navigation.yml))` patter to exclude all dot files except `.navigation.yml`.
181+
182+
```ts
183+
defineCollection({
184+
source: {
185+
include: '**',
186+
exclude: ['**/.!(navigation.yml)']
187+
}
188+
})
189+
```
190+
191+
192+

0 commit comments

Comments
 (0)