Skip to content

Commit

Permalink
Remove experimental from content collections! (#2354)
Browse files Browse the repository at this point in the history
* edit: remove experimental from content collections!

* edit: update "since" to 2.0.0
  • Loading branch information
bholmesdev authored Jan 12, 2023
1 parent 5c52a20 commit b1b1f0e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 19 deletions.
17 changes: 2 additions & 15 deletions src/pages/en/guides/content-collections.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
layout: ~/layouts/MainLayout.astro
title: Content Collections (Experimental)
title: Content Collections
description: >-
Content collections help organize your Markdown and type-check your
frontmatter with schemas.
Expand All @@ -13,7 +13,7 @@ import TypeScriptSettingTabs from '~/components/tabs/TypeScriptSettingTabs.astro


<p>
<Since v="1.7.0" />
<Since v="2.0.0" />
</p>

Content collections help organize your Markdown or MDX and type-check your frontmatter with schemas. Collections may be helpful if you:
Expand All @@ -25,19 +25,6 @@ Content collections help organize your Markdown or MDX and type-check your front

First, run the [`astro dev`](/en/reference/cli-reference/#astro-dev), [`astro build`](/en/reference/cli-reference/#astro-build), or [`astro sync`](/en/reference/cli-reference/#astro-sync) commands to generate types. This will make the `astro:content` module available for [querying](#querying-content-collections) and [configuring](#configuring-collections) your content collections.

Content Collections are experimental. To enable this feature, set the `experimental.contentCollections` flag in your Astro config:

```js
// astro.config.mjs
import { defineConfig } from 'astro';

export default defineConfig({
experimental: {
contentCollections: true,
},
});
```

### Update TypeScript configuration

To benefit from the full TypeScript and autocompletion features of [using schemas with your collections](#defining-a-collection-schema), you may also need to update `tsconfig.json`. Follow the instructions below based on your Astro project's current [TypeScript configuration](/en/guides/typescript/#setup).
Expand Down
4 changes: 2 additions & 2 deletions src/pages/en/reference/api-reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -702,10 +702,10 @@ Pagination will pass a `page` prop to every rendered page that represents a sing
| `page.url.prev` | `string \| undefined` | Get the URL of the previous page (will be `undefined` if on page 1). |
| `page.url.next` | `string \| undefined` | Get the URL of the next page (will be `undefined` if no more pages). |

## Content Collections (Experimental)
## Content Collections

<p>
<Since v="1.7.0" />
<Since v="2.0.0" />
</p>

Content collections offer APIs to configure and query your Markdown or MDX documents in `src/content/`. For features and usage examples, [see our content collections guide](/en/guides/content-collections/).
Expand Down
4 changes: 2 additions & 2 deletions src/pages/en/reference/cli-reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -116,14 +116,14 @@ This command only checks types within `.astro` files.
## `astro sync`

<p>
<Since v="1.7.0" />
<Since v="2.0.0" />
</p>

:::tip
Running `astro dev` or `astro build` will run the `sync` command as well.
:::

Generates TypeScript types for all Astro modules. This sets up a [`src/env.d.ts` file](/en/guides/typescript/#setup) for type inferencing, and defines the `astro:content` module for the (experimental) [Content Collections API](/en/guides/content-collections/).
Generates TypeScript types for all Astro modules. This sets up a [`src/env.d.ts` file](/en/guides/typescript/#setup) for type inferencing, and defines the `astro:content` module for the [Content Collections API](/en/guides/content-collections/).

## `astro add`

Expand Down

0 comments on commit b1b1f0e

Please sign in to comment.