๐ Patch Changes
- #9797
457e8b6422704ba23347c766a8bb9c101c2aba0bThanks @wkillerud! - RestoresrssSchemato a zod object
457e8b6422704ba23347c766a8bb9c101c2aba0b Thanks @wkillerud! - Restores rssSchema to a zod object7356336d18c916804001bdf64bff5445d82baceb Thanks @florian-lefebvre! - Fixes rssSchema definition to allow calling standard zod object methods (like extend)24663c9695385fed9ece57bf4aecdca3a8581e70 Thanks @florian-lefebvre! - Fixes the RSS schema to make the title optional if the description is already provided. It also makes pubDate and link optional, as specified in the RSS specification.edfae50e6 Thanks @cdvillard! - Improves the @astrojs/rss error message thrown when the object passed to the items property is missing any of the three required keys or if one of those keys is mistyped.#8188 d0679a666 Thanks @ematipico! - Remove support for Node 16. The lowest supported version by Astro and all integrations is now v18.14.1. As a reminder, Node 16 will be deprecated on the 11th September 2023.
#8179 6011d52d3 Thanks @matthewp! - Astro 3.0 Release Candidate
#8198 cb95aa5f8 Thanks @bluwy! - Update the rss() default export to return a Response instead of a simple object, which is deprecated in Astro 3.0. If you were directly returning the rss() result from an endpoint before, this breaking change should not affect you.
You can also import getRssString() to get the RSS string directly and use it to return your own Response:
import { getRssString } from '@astrojs/rss';
export async function get(context) { const rssString = await getRssString({ title: 'Buzzโs Blog', ... });
return new Response(rssString, { headers: { 'Content-Type': 'application/xml', }, });}#8099 732111cdc Thanks @bluwy! - Deprecate the markdown.drafts configuration option.
If youโd like to create draft pages that are visible in dev but not in production, you can migrate to content collections and manually filter out pages with the draft: true frontmatter property instead.
#8198 cb95aa5f8 Thanks @bluwy! - Update the rss() default export to return a Response instead of a simple object, which is deprecated in Astro 3.0. If you were directly returning the rss() result from an endpoint before, this breaking change should not affect you.
You can also import getRssString() to get the RSS string directly and use it to return your own Response:
import { getRssString } from '@astrojs/rss';
export async function get(context) { const rssString = await getRssString({ title: 'Buzzโs Blog', ... });
return new Response(rssString, { headers: { 'Content-Type': 'application/xml', }, });}#8099 732111cdc Thanks @bluwy! - Deprecate the markdown.drafts configuration option.
If youโd like to create draft pages that are visible in dev but not in production, you can migrate to content collections and manually filter out pages with the draft: true frontmatter property instead.
51028f85c Thanks @DerTimonius! - Add URL to RSSOptions.site type1eae2e3f7 Thanks @Princesseuh! - Remove support for Node 16. The lowest supported version by Astro and all integrations is now v18.14.1. As a reminder, Node 16 will be deprecated on the 11th September 2023.e17ed0727 Thanks @AkashRajpurohit! - exposes RSSFeedItem typeb5482cee2 Thanks @bholmesdev! - Fix: remove accidental stripping of trailing /1/ on canonical URLsb1b9b1390 Thanks @aivarsliepa! - Fixes RSSOptions type error when using strictest Typescript tsconfig400ef26c9 Thanks @bholmesdev! - Preserve self-closing tags in customData option#6453 2e362042c Thanks @ematipico! - Added trailingSlash option to control whether or not the emitted URLs should have trailing slashes.
import rss from '@astrojs/rss';
export const get = () => rss({ trailingSlash: false, });By passing false, the emitted links wonโt have trailing slashes.
afbbc4d5b Thanks @Princesseuh! - Updated compilation settings to disable downlevelling for Node 14#5851 81dce94f2 Thanks @bholmesdev! - 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:
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:
import { defineCollection } from 'astro:content';import { rssSchema } from '@astrojs/rss';
const blog = defineCollection({ schema: rssSchema,});
export const collections = { blog };