summaryrefslogtreecommitdiff
path: root/packages/astro-rss/src
diff options
context:
space:
mode:
authorGravatar Matthew Phillips <matthew@skypack.dev> 2023-11-30 10:03:51 -0500
committerGravatar GitHub <noreply@github.com> 2023-11-30 10:03:51 -0500
commitfbf145af8a792ee7334be577fbdf0bba9782b4e7 (patch)
treea5212b8b8f12d734579db8a2bb90dd4c772cba44 /packages/astro-rss/src
parentff8eadb95d34833baaf3ec7575bf4f293eae97da (diff)
parent05628aaa3c9a3702b59cbf3d0e99abf66df651df (diff)
downloadastro-fbf145af8a792ee7334be577fbdf0bba9782b4e7.tar.gz
astro-fbf145af8a792ee7334be577fbdf0bba9782b4e7.tar.zst
astro-fbf145af8a792ee7334be577fbdf0bba9782b4e7.zip
Merge pull request #9247 from withastro/next
Merge the `next` branch into `main` for the 4.0 release
Diffstat (limited to 'packages/astro-rss/src')
-rw-r--r--packages/astro-rss/src/index.ts16
-rw-r--r--packages/astro-rss/src/schema.ts1
2 files changed, 1 insertions, 16 deletions
diff --git a/packages/astro-rss/src/index.ts b/packages/astro-rss/src/index.ts
index a611afc16..48c5defe8 100644
--- a/packages/astro-rss/src/index.ts
+++ b/packages/astro-rss/src/index.ts
@@ -27,11 +27,6 @@ export type RSSOptions = {
stylesheet?: z.infer<typeof rssOptionsValidator>['stylesheet'];
/** Specify custom data in opening of file */
customData?: z.infer<typeof rssOptionsValidator>['customData'];
- /**
- * Whether to include drafts or not
- * @deprecated Deprecated since version 3.0. Use content collections instead.
- */
- drafts?: z.infer<typeof rssOptionsValidator>['drafts'];
trailingSlash?: z.infer<typeof rssOptionsValidator>['trailingSlash'];
};
@@ -48,11 +43,6 @@ export type RSSFeedItem = {
description?: z.infer<typeof rssSchema>['description'];
/** Append some other XML-valid data to this item */
customData?: z.infer<typeof rssSchema>['customData'];
- /**
- * Whether draft or not
- * @deprecated Deprecated since version 3.0. Use content collections instead.
- */
- draft?: z.infer<typeof rssSchema>['draft'];
/** Categories or tags related to the item */
categories?: z.infer<typeof rssSchema>['categories'];
/** The item author's email address */
@@ -92,7 +82,6 @@ const rssOptionsValidator = z.object({
return items;
}),
xmlns: z.record(z.string()).optional(),
- drafts: z.boolean().default(false),
stylesheet: z.union([z.string(), z.boolean()]).optional(),
customData: z.string().optional(),
trailingSlash: z.boolean().default(true),
@@ -159,10 +148,7 @@ export function pagesGlobToRssItems(items: GlobResult): Promise<ValidatedRSSFeed
/** Generate RSS 2.0 feed */
async function generateRSS(rssOptions: ValidatedRSSOptions): Promise<string> {
- const { site } = rssOptions;
- const items = rssOptions.drafts
- ? rssOptions.items
- : rssOptions.items.filter((item) => !item.draft);
+ const { items, site } = rssOptions;
const xmlOptions = {
ignoreAttributes: false,
diff --git a/packages/astro-rss/src/schema.ts b/packages/astro-rss/src/schema.ts
index eb15ecd58..98aa35f81 100644
--- a/packages/astro-rss/src/schema.ts
+++ b/packages/astro-rss/src/schema.ts
@@ -8,7 +8,6 @@ export const rssSchema = z.object({
.refine((value) => !isNaN(value.getTime())),
description: z.string().optional(),
customData: z.string().optional(),
- draft: z.boolean().optional(),
categories: z.array(z.string()).optional(),
author: z.string().optional(),
commentsUrl: z.string().optional(),