Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions src/pages/rss.xml.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { getCollection } from 'astro:content';
import type { APIContext } from 'astro';
import sanitizeHtml from 'sanitize-html';
import MarkdownIt from 'markdown-it';
import { getPostImage } from '../lib/posts';

const parser = new MarkdownIt();

Expand Down Expand Up @@ -49,13 +50,12 @@ export async function GET(context: APIContext) {
}),
};

if (post.data.image) {
item.enclosure = {
url: `${site}${post.data.image.src}`,
type: getMimeType(post.data.image.src),
length: 0,
};
}
const image = getPostImage(post);
item.enclosure = {
url: `${site}${image.src}`,
type: getMimeType(image.src),
length: 0,
};

// Add custom data for bluesky post ID if present
if (post.data.blueskyPostId) {
Expand Down