summaryrefslogtreecommitdiff
path: root/packages/astro-rss/src
diff options
context:
space:
mode:
authorGravatar Bjorn Lu <bjornlu.dev@gmail.com> 2023-11-28 00:44:20 +0800
committerGravatar GitHub <noreply@github.com> 2023-11-28 00:44:20 +0800
commit153a5abb905042ac68b712514dc9ec387d3e6b17 (patch)
tree542cbbdcd46bc03c30a1ede225f721ad85f09622 /packages/astro-rss/src
parentc7953645eeaaf9e87c6db4494b0023d2c1878ff0 (diff)
downloadastro-153a5abb905042ac68b712514dc9ec387d3e6b17.tar.gz
astro-153a5abb905042ac68b712514dc9ec387d3e6b17.tar.zst
astro-153a5abb905042ac68b712514dc9ec387d3e6b17.zip
Remove deprecated features from Astro 3.0 (#9168)
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(),