summaryrefslogtreecommitdiff
path: root/.changeset/fluffy-cups-travel.md
blob: aa22e3d911e84df600680d5a3a3bc80c1aa62ce1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
---
'@astrojs/rss': minor
---

Update RSS config for readability and consistency with Astro 2.0.

#### Migration - `import.meta.glob()` handling

We have deprecated `items: import.meta.glob(...)` handling in favor of a separate `pagesGlobToRssItems()` helper. This simplifies our `items` configuration option to accept a single type, without losing existing functionality.

If you rely on our `import.meta.glob()` handling, we suggest adding the `pagesGlobToRssItems()` wrapper to your RSS config:

```diff
// src/pages/rss.xml.js
import rss, {
+  pagesGlobToRssItems
} from '@astrojs/rss';

export function get(context) {
  return rss({
+    items: pagesGlobToRssItems(
      import.meta.glob('./blog/*.{md,mdx}'),
+    ),
  });
}
```

#### New `rssSchema` for content collections

`@astrojs/rss` now exposes an `rssSchema` for use with content collections. This ensures all RSS feed properties are present in your frontmatter:

```ts
import { defineCollection } from 'astro:content';
import { rssSchema } from '@astrojs/rss';

const blog = defineCollection({
  schema: rssSchema,
});

export const collections = { blog };
```