Complete the code to import the RSS builder from Astro.
import { [1] } from '@astrojs/rss';
The rss function is the correct import from '@astrojs/rss' to build RSS feeds.
Complete the code to define the RSS feed's title.
export const get = () => rss({ title: '[1]', description: 'Latest posts', site: 'https://example.com' });The title field should describe the feed. 'Blog Posts' is a clear, concise title.
Fix the error in the code to correctly generate RSS items from posts.
const items = posts.map(post => ({ title: post.title, pubDate: post.[1] }));The standard property for publication date in Astro posts is usually date.
Fill both blanks to complete the RSS feed export with correct content and URL.
export const get = () => rss({ title: 'My Site', description: 'Updates', site: 'https://example.com', items: posts.map(post => ({ title: post.title, link: post.[1], pubDate: post.[2] })) });The link should use the post's slug to build the URL, and pubDate uses the date property.
Fill all three blanks to generate an RSS feed with custom XML namespaces and correct item fields.
export const get = () => rss({ title: 'News', description: 'Latest news', site: 'https://news.example.com', xmlns: { [1]: 'http://www.w3.org/2005/Atom' }, items: posts.map(post => ({ title: post.title, link: post.[2], pubDate: post.[3] })) });The xmlns key should be 'atom' for the Atom namespace. The item link uses the post's slug, and pubDate uses the date.
