Fixed rss images
This commit is contained in:
@@ -9,9 +9,21 @@ export async function GET(context) {
|
||||
title: SITE_TITLE,
|
||||
description: SITE_DESCRIPTION,
|
||||
site: context.site,
|
||||
items: posts.map((post) => ({
|
||||
items: posts.map((post) => {
|
||||
let item = {
|
||||
...post.data,
|
||||
link: `/blog/${post.id}/`,
|
||||
})),
|
||||
};
|
||||
|
||||
if (post.data.heroImage) {
|
||||
item.enclosure = {
|
||||
url: post.data.heroImage.src,
|
||||
length: post.data.heroImage.width * post.data.heroImage.height,
|
||||
type: `image/${post.data.heroImage.format}`
|
||||
}
|
||||
}
|
||||
|
||||
return item;
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
@@ -9,9 +9,21 @@ export async function GET(context) {
|
||||
title: SITE_TITLE,
|
||||
description: SITE_DESCRIPTION,
|
||||
site: context.site,
|
||||
items: posts.map((post) => ({
|
||||
...post.data,
|
||||
link: `/projects/${post.id}/`,
|
||||
})),
|
||||
items: posts.map((project) => {
|
||||
let item = {
|
||||
...project.data,
|
||||
link: `/projects/${project.id}/`,
|
||||
};
|
||||
|
||||
if (project.data.heroImage) {
|
||||
item.enclosure = {
|
||||
url: project.data.heroImage.src,
|
||||
length: project.data.heroImage.width * project.data.heroImage.height,
|
||||
type: `image/${project.data.heroImage.format}`
|
||||
}
|
||||
}
|
||||
|
||||
return item;
|
||||
}),
|
||||
});
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ export async function GET(context) {
|
||||
link: `/projects/${project.id}/`,
|
||||
};
|
||||
|
||||
if (project.heroImage) {
|
||||
if (project.data.heroImage) {
|
||||
item.enclosure = {
|
||||
url: project.data.heroImage.src,
|
||||
length: project.data.heroImage.width * project.data.heroImage.height,
|
||||
|
||||
Reference in New Issue
Block a user