mirror of
https://github.com/anotherhadi/blog.git
synced 2026-04-02 11:42:10 +02:00
Add images to rss feed
Signed-off-by: Hadi <112569860+anotherhadi@users.noreply.github.com>
This commit is contained in:
@@ -11,6 +11,11 @@ export async function GET(context: APIContext) {
|
|||||||
pubDate: post.data.publishDate,
|
pubDate: post.data.publishDate,
|
||||||
description: post.data.description,
|
description: post.data.description,
|
||||||
link: `/blog/${post.id}/`,
|
link: `/blog/${post.id}/`,
|
||||||
|
enclosure: {
|
||||||
|
url: new URL(post.data.image.src, context.site).toString(),
|
||||||
|
length: 0,
|
||||||
|
type: "image/png",
|
||||||
|
},
|
||||||
}));
|
}));
|
||||||
|
|
||||||
const projectItems = projects.map((project) => ({
|
const projectItems = projects.map((project) => ({
|
||||||
@@ -18,6 +23,11 @@ export async function GET(context: APIContext) {
|
|||||||
pubDate: new Date(),
|
pubDate: new Date(),
|
||||||
description: project.data.description,
|
description: project.data.description,
|
||||||
link: `/projects/${project.id}/`,
|
link: `/projects/${project.id}/`,
|
||||||
|
enclosure: {
|
||||||
|
url: new URL(project.data.image.src, context.site).toString(),
|
||||||
|
length: 0,
|
||||||
|
type: "image/png",
|
||||||
|
},
|
||||||
}));
|
}));
|
||||||
|
|
||||||
const allItems = [...blogItems, ...projectItems].sort(
|
const allItems = [...blogItems, ...projectItems].sort(
|
||||||
|
|||||||
Reference in New Issue
Block a user