astro-accelerator 7.1.27 → 7.1.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
package/src/pages/rss.xml.ts
CHANGED
|
@@ -22,18 +22,6 @@ function escapeXml(text: string): string {
|
|
|
22
22
|
.replace(/'/g, ''');
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
function getAbsoluteImageUrl(src: unknown): string | undefined {
|
|
26
|
-
if (typeof src !== 'string' || src.length === 0) {
|
|
27
|
-
return undefined;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
try {
|
|
31
|
-
return new URL(src, SITE.url).href;
|
|
32
|
-
} catch {
|
|
33
|
-
return undefined;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
25
|
async function getData() {
|
|
38
26
|
//@ts-ignore
|
|
39
27
|
const allArticles = import.meta.glob(['./**/*.md', './**/*.mdx']);
|
|
@@ -95,7 +83,6 @@ async function getData() {
|
|
|
95
83
|
.slice(0, limit)
|
|
96
84
|
.map(
|
|
97
85
|
(a) => {
|
|
98
|
-
const imageUrl = getAbsoluteImageUrl(a.frontmatter.bannerImage?.src);
|
|
99
86
|
return `
|
|
100
87
|
<entry>
|
|
101
88
|
<title>${escapeXml(a.frontmatter.title ?? '')}</title>
|
|
@@ -104,7 +91,9 @@ async function getData() {
|
|
|
104
91
|
<published>${a.frontmatter.pubDate}</published>
|
|
105
92
|
<updated>${a.frontmatter.modDate ?? a.frontmatter.pubDate}</updated>
|
|
106
93
|
<summary>${escapeXml(a.frontmatter.description ?? '')}</summary>
|
|
107
|
-
${
|
|
94
|
+
${a.frontmatter.bannerImage?.src
|
|
95
|
+
? `<link rel="enclosure" href="${SITE.url + a.frontmatter.bannerImage?.src}" type="image/*" />`
|
|
96
|
+
: ''}
|
|
108
97
|
<author>
|
|
109
98
|
<name>${escapeXml(getAuthorName(a.frontmatter))}</name>
|
|
110
99
|
</author>
|
|
File without changes
|
|
File without changes
|