Skip to content

Commit

Permalink
[v5 upgrade] include MDX in collections instructions (#10543)
Browse files Browse the repository at this point in the history
Co-authored-by: Louis Escher <[email protected]>
  • Loading branch information
sarah11918 and louisescher authored Dec 27, 2024
1 parent 8663c9e commit 11b0d58
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/content/docs/en/guides/upgrade-to/v5.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ See the instructions below for updating an existing content collection (`type: '

1. **Move the content config file**. This file no longer lives within the `src/content/` folder. This file should now exist at `src/content.config.ts`.

2. **Edit the collection definition**. Your updated collection requires a `loader`, and the option to select a collection `type` is no longer available.
2. **Edit the collection definition**. Your updated collection requires a `loader` which indicates both a folder for the location of your collection (`base`) and a `pattern` defining the collection entry filenames and extensions to match. (You may need to update the example below accordingly. You can use [globster.xyz](https://globster.xyz/) to check your glob pattern.) The option to select a collection `type` is no longer available.

```ts ins={3,8} del={7}
// src/content.config.ts
Expand All @@ -131,7 +131,7 @@ See the instructions below for updating an existing content collection (`type: '
const blog = defineCollection({
// For content layer you no longer define a `type`
type: 'content',
loader: glob({ pattern: '**/[^_]*.md', base: "./src/data/blog" }),
loader: glob({ pattern: '**/[^_]*.{md,mdx}', base: "./src/data/blog" }),
schema: z.object({
title: z.string(),
description: z.string(),
Expand Down

0 comments on commit 11b0d58

Please sign in to comment.