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