Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
530c68f
remove legacy note, start to rewrite introduction
sarah11918 Oct 18, 2025
7a36689
what are content collections?
sarah11918 Oct 18, 2025
a0940ae
types of collections section
sarah11918 Oct 18, 2025
0e5b449
more about collections
sarah11918 Oct 18, 2025
cd362bd
attempt at redoing the loader section
sarah11918 Oct 19, 2025
cc8cd1b
more section heading work
sarah11918 Oct 19, 2025
20150cf
more sections added to incorporate and organize live collections
sarah11918 Oct 19, 2025
706d7d1
more attention to "quick start" of easy case, streamlining Accessing …
sarah11918 Oct 20, 2025
e3a03df
incorporate current updates to content collections guide page
sarah11918 Oct 22, 2025
ff9926f
way more links to make happy paths, and attempts to make loader conte…
sarah11918 Oct 22, 2025
1b192b1
some polish to generating routes section
sarah11918 Oct 22, 2025
7167df0
talk about generating pages for each type of collection to get links …
sarah11918 Oct 22, 2025
d8be8e7
placeholder content for astro:content reference items (and so links w…
sarah11918 Oct 22, 2025
25e1fff
Merge branch 'v6' into stable-live-collections
sarah11918 Oct 22, 2025
53d6f32
update `/en/` broken links
sarah11918 Oct 22, 2025
8fb34fd
fix one more en link
sarah11918 Oct 22, 2025
2738a82
actcually fix en link
sarah11918 Oct 22, 2025
f4e8d2a
fix international links, mostly by deleting German pages slated for d…
sarah11918 Oct 22, 2025
0e1cd7a
astro:module nits/easy commits
sarah11918 Oct 23, 2025
d6ea42f
Merge branch 'v6' into stable-live-collections
sarah11918 Oct 23, 2025
b9e06cf
Merge branch 'v6' into stable-live-collections
sarah11918 Oct 24, 2025
2d40073
update chnaged anchor links
sarah11918 Oct 24, 2025
aa5f25d
[v6] Update `astro:content` docs (#12620)
ArmandPhilippot Nov 3, 2025
7b1dd81
revised What are Collections and When (not) to Use sections
sarah11918 Nov 4, 2025
928cbaa
actual working example for build-time collections
sarah11918 Nov 4, 2025
55edf6a
Armand typo fix
sarah11918 Nov 4, 2025
b0e59d0
remove duplicate sentence
sarah11918 Nov 4, 2025
422a94d
lower case npm
sarah11918 Nov 4, 2025
a3e2d50
Merge branch 'stable-live-collections' of https://github.com/withastr…
sarah11918 Nov 4, 2025
02e9773
errant section heading levels fixed
sarah11918 Nov 4, 2025
b659cd9
define entry, update example to use getCollection
sarah11918 Nov 4, 2025
ebe1f8f
reorganization into build time and live main sections
sarah11918 Nov 4, 2025
1dd7a5c
missing preposition
sarah11918 Nov 5, 2025
d93b60b
updated holdover legacy references
sarah11918 Nov 5, 2025
bc8622d
when one or more of these is true...
sarah11918 Nov 5, 2025
33c76fb
build-time loaders polish
sarah11918 Nov 7, 2025
aebfd5c
build-time schema polish
sarah11918 Nov 7, 2025
617659a
live collections polish
sarah11918 Nov 7, 2025
ef68d7d
attempt to better organize and handle "pile of sections" at the bottom
sarah11918 Nov 7, 2025
b479c55
remove live collection limitations heading and work into section dire…
sarah11918 Nov 7, 2025
1f648da
Merge branch 'v6' into stable-live-collections
sarah11918 Nov 7, 2025
ed51725
heading weirdness
sarah11918 Nov 7, 2025
d7acbe4
[V6]: Various fixes in content collections pages (#12685)
ArmandPhilippot Nov 10, 2025
a20b8cd
Apply suggestions from Yan final boss code review
sarah11918 Nov 10, 2025
f1d5e34
comma and extra space
sarah11918 Nov 10, 2025
31c2d18
Apply more suggestions from Yan code review
sarah11918 Nov 10, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/content/docs/en/guides/cms/keystatic.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ Visit `http://127.0.0.1:4321/keystatic` in the browser to see the Keystatic Admi

## Rendering Keystatic content

Use Astro's Content Collections API to [query and display your posts and collections](/en/guides/content-collections/#querying-collections), just as you would in any Astro project.
[Query and display your posts and collections](/en/guides/content-collections/#querying-build-time-collections), just as you would in any Astro project.

### Displaying a collection list

Expand Down
871 changes: 746 additions & 125 deletions src/content/docs/en/guides/content-collections.mdx

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/content/docs/en/guides/imports.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ Additionally, glob patterns must begin with one of the following:

### `import.meta.glob()` vs `getCollection()`

[Content collections](/en/guides/content-collections/) provide a [`getCollection()` API](/en/reference/modules/astro-content/#getcollection) for loading multiple files instead of `import.meta.glob()`. If your content files (e.g. Markdown, MDX, Markdoc) are located in collections within the `src/content/` directory, use `getCollection()` to [query a collection](/en/guides/content-collections/#querying-collections) and return content entries.
[Content collections](/en/guides/content-collections/) provide [performant, content-focused APIs](/en/reference/modules/astro-content/) for loading multiple files instead of `import.meta.glob()`. Use `getCollection()` and `getLiveCollection()` to query your collections and return content entries.

## WASM

Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/en/guides/integrations-guide/markdoc.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ Markdoc files can only be used within content collections. Add entries to any co
- quick-start.mdoc
</FileTree>

Then, query your collection using the [Content Collection APIs](/en/guides/content-collections/#querying-collections):
Then, [query and display your posts and collections](/en/guides/content-collections/#querying-build-time-collections):

```astro title="src/pages/why-markdoc.astro"
---
Expand Down
4 changes: 2 additions & 2 deletions src/content/docs/en/guides/integrations-guide/mdx.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,9 @@ It also adds extra features to standard MDX, including support for Markdown-styl

`.mdx` files must be written in [MDX syntax](https://mdxjs.com/docs/what-is-mdx/#mdx-syntax) rather than Astro’s HTML-like syntax.

### Using MDX with content collections
### Using local MDX with content collections

To include MDX files in a content collection, make sure that your [collection loader](/en/guides/content-collections/#defining-the-collection-loader) is configured to load content from `.mdx` files:
To include your local MDX files in a content collection, make sure that your [collection loader](/en/guides/content-collections/#build-time-collection-loaders) is configured to load content from `.mdx` files:

```js title="src/content.config.ts" ins="mdx"
import { defineCollection, z } from 'astro:content';
Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/en/guides/markdown-content.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ When using the frontmatter `layout` property, you must include the `<meta charse

Astro's internal Markdown processor is not available for processing remote Markdown.

To fetch remote Markdown for use in [content collections](/en/guides/content-collections/), you can [build a custom loader](/en/guides/content-collections/#building-a-custom-loader) with access to a [`renderMarkdown()` function](/en/reference/content-loader-reference/#rendermarkdown).
To fetch remote Markdown for use in [content collections](/en/guides/content-collections/), you can [build a custom loader](/en/guides/content-collections/#custom-build-time-loaders) with access to a [`renderMarkdown()` function](/en/reference/content-loader-reference/#rendermarkdown).

To fetch remote Markdown directly and render it to HTML, you will need to install and configure your own Markdown parser from NPM. This will not inherit from any of Astro's built-in Markdown settings that you have configured.

Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/en/guides/media/cloudinary.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ export const collections = {
}
```
You can then use the [`getCollection()` or `getEntry()` query functions](/en/guides/content-collections/#querying-collections) to select one or many images or videos from your collection.
You can then use the [`getCollection()` or `getEntry()` query functions](/en/guides/content-collections/#querying-build-time-collections) to select one or many images or videos from your collection.
See [Cloudinary's `cldAssetsLoader` documentation](https://astro.cloudinary.dev/cldassetsloader/basic-usage) for more information.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ const randomUser = data.results[0];
---
```

See more about local files imports with [`import.meta.glob()`](/en/guides/imports/#importmetaglob), [querying using the Collections API](/en/guides/content-collections/#querying-collections) or [fetching remote data](/en/guides/data-fetching/).
See more about local files imports with [`import.meta.glob()`](/en/guides/imports/#importmetaglob), [querying with content collections](/en/guides/content-collections/#querying-build-time-collections) or [fetching remote data](/en/guides/data-fetching/).

### CRA Styling to Astro

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ When you rebuild your Gatsby site in Astro, you will notice some important diffe

- [Astro components](/en/basics/astro-components/) are not written as exported functions that return page templating. Instead, you'll split your code into a "code fence" for your JavaScript and a body exclusively for the HTML you generate.

- [Local file data](/en/guides/imports/): Gatsby uses GraphQL to retrieve data from your project files. Astro uses ESM imports and top-level await functions (e.g. [`import.meta.glob()`](/en/guides/imports/#importmetaglob), [`getCollection()`](/en/guides/content-collections/#querying-collections)) to import data from your project files. You can manually add GraphQL to your Astro project but it is not included by default.
- [Local file data](/en/guides/imports/): Gatsby uses GraphQL to retrieve data from your project files. Astro uses ESM imports and top-level await functions (e.g. [`import.meta.glob()`](/en/guides/imports/#importmetaglob), [`getCollection()`](/en/guides/content-collections/#querying-build-time-collections)) to import data from your project files. You can manually add GraphQL to your Astro project but it is not included by default.

## Convert your Gatsby Project

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ const randomUser = data.results[0];
---
```

See more about local files imports with [`import.meta.glob()`](/en/guides/imports/#importmetaglob), [querying using the Collections API](/en/guides/content-collections/#querying-collections) or [fetching remote data](/en/guides/data-fetching/).
See more about local files imports with [`import.meta.glob()`](/en/guides/imports/#importmetaglob), [querying with content collections](/en/guides/content-collections/#querying-build-time-collections) or [fetching remote data](/en/guides/data-fetching/).

### Next Styling to Astro

Expand Down
4 changes: 2 additions & 2 deletions src/content/docs/en/guides/upgrade-to/v6.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ If you have [content collections errors](/en/reference/error-reference/#content-

<details>
<summary>no content collections configuration file</summary>
Create `src/content.config.ts` and [define your collections](/en/guides/content-collections/#defining-collections) in it.
Create `src/content.config.ts` and [define your collections](/en/guides/content-collections/#build-time-content-collections) in it.
</details>

<details>
Expand All @@ -205,7 +205,7 @@ Rename and move this file to `src/content.config.ts`
<details>
<summary>a collection that does not define a `loader`/ ([`ContentCollectionMissingALoaderError`](/en/reference/errors/content-collection-missing-loader/))</summary>

Import [Astro's built-in `glob()` loader](/en/guides/content-collections/#built-in-loaders) and define the `pattern` and `base` for your collection entries:
Import [Astro's built-in `glob()` loader](/en/guides/content-collections/#the-glob-loader) and define the `pattern` and `base` for your collection entries:

```ts ins={3,6}
// src/content.config.ts
Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/en/reference/cli-reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ astro --config config/astro.config.mjs dev

<p><Since v="5.0.0" /></p>

Clear the [content layer cache](/en/guides/content-collections/#defining-the-collection-loader), forcing a full rebuild.
Clear the content layer cache, forcing a full rebuild.

### `--mode <string>`

Expand Down
Loading
Loading