You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Change the optional "canonicalUrl" argument to a required "site" argument. This fixes problems with import.meta.env.SITE. If you want to use your project's "site" field for your RSS feeds, set site: import.meta.env.SITE in the rss function options
The `<description>` attribute of your RSS feed's output xml.
72
73
74
+
### site
75
+
76
+
Type: `string (required)`
77
+
78
+
The base URL to use when generating RSS item links. We recommend using `import.meta.env.SITE` to pull in the "site" from your project's astro.config. Still, feel free to use a custom base URL if necessary.
79
+
73
80
### items
74
81
75
82
Type: `RSSFeedItem[] | GlobResult (required)`
@@ -135,11 +142,7 @@ Will inject the following XML:
The base URL to use when generating RSS item links. This defaults to the [`site` configured in your project's `astro.config`](https://docs.astro.build/en/reference/configuration-reference/#site). We recommend using `site` instead of `canonicalUrl`, though we provide this option if an override is necessary.
145
+
---
143
146
144
147
For more on building with Astro, [visit the Astro docs][astro-rss].
constvalidXmlResult=`<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"><channel><title><![CDATA[My RSS feed]]></title><description><![CDATA[This sure is a nice RSS feed]]></description><link>https://example.com/</link><item><title><![CDATA[Remember PHP?]]></title><link>https://example.com/php/</link><guid>https://example.com/php/</guid><description><![CDATA[PHP is a general-purpose scripting language geared toward web development. It was originally created by Danish-Canadian programmer Rasmus Lerdorf in 1994.]]></description><pubDate>Tue, 03 May 1994 00:00:00 GMT</pubDate></item><item><title><![CDATA[Web 1.0]]></title><link>https://example.com/web1/</link><guid>https://example.com/web1/</guid><description><![CDATA[Web 1.0 is the term used for the earliest version of the Internet as it emerged from its origins with Defense Advanced Research Projects Agency (DARPA) and became, for the first time, a global network representing the future of digital communications.]]></description><pubDate>Sat, 03 May 1997 00:00:00 GMT</pubDate></item></channel></rss>`;
30
30
31
31
describe('rss',()=>{
32
-
it('should fail on missing "site" and/or "canonicalUrl"',()=>{
33
-
returnchai.expect(
34
-
rss({
35
-
title,
36
-
description,
37
-
items: [],
38
-
})
39
-
).to.be.rejected;
40
-
});
41
-
42
32
it('should generate on valid RSSFeedItem array',async()=>{
0 commit comments