We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d6104f5 commit 18ef57bCopy full SHA for 18ef57b
1 file changed
src/pages/rss.xml.ts
@@ -3,6 +3,7 @@ import { getCollection } from 'astro:content';
3
import type { APIContext } from 'astro';
4
import sanitizeHtml from 'sanitize-html';
5
import MarkdownIt from 'markdown-it';
6
+import { getPostImage } from '../lib/posts';
7
8
const parser = new MarkdownIt();
9
@@ -49,13 +50,12 @@ export async function GET(context: APIContext) {
49
50
}),
51
};
52
- if (post.data.image) {
53
- item.enclosure = {
54
- url: `${site}${post.data.image.src}`,
55
- type: getMimeType(post.data.image.src),
56
- length: 0,
57
- };
58
- }
+ const image = getPostImage(post);
+ item.enclosure = {
+ url: `${site}${image.src}`,
+ type: getMimeType(image.src),
+ length: 0,
+ };
59
60
// Add custom data for bluesky post ID if present
61
if (post.data.blueskyPostId) {
0 commit comments