Merge pull request #6 from juancmandev/dev

add feed img
This commit is contained in:
Juan Manzanero 2024-07-02 22:00:36 +00:00 committed by GitHub
commit d029dba1b9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -61,7 +61,6 @@ export async function GET(context: any) {
title: post.data.title, title: post.data.title,
pubDate: post.data.date, pubDate: post.data.date,
description: post.data.description, description: post.data.description,
author: post.data.author,
link: `/blog/${post.slug}/`, link: `/blog/${post.slug}/`,
content: sanitizeHtml(html.toString(), { content: sanitizeHtml(html.toString(), {
allowedTags: sanitizeHtml.defaults.allowedTags.concat(["img"]), allowedTags: sanitizeHtml.defaults.allowedTags.concat(["img"]),
@ -103,7 +102,6 @@ export async function GET(context: any) {
title: project.data.title, title: project.data.title,
pubDate: project.data.date, pubDate: project.data.date,
description: project.data.description, description: project.data.description,
author: project.data.author,
link: `/portfolio/${project.slug}/`, link: `/portfolio/${project.slug}/`,
content: sanitizeHtml(html.toString(), { content: sanitizeHtml(html.toString(), {
allowedTags: sanitizeHtml.defaults.allowedTags.concat(["img"]), allowedTags: sanitizeHtml.defaults.allowedTags.concat(["img"]),
@ -112,13 +110,19 @@ export async function GET(context: any) {
} }
return rss({ return rss({
xmlns: { atom: "http://www.w3.org/2005/Atom" },
title: "juancmandev", title: "juancmandev",
description: "Welcome to my domain, stranger.", description: "Welcome to my domain, stranger.",
customData: `<language>en-us</language><image>
<url>https://juancman.dev/logo.png</url>
<title>juancmandev</title>
</image>`,
site: context.site, site: context.site,
customData: [
"<language>en-us</language>",
`<image>
<url>https://www.juancman.dev/logo.png</url>
<title>juancmandev</title>
<link>https://www.juancman.dev</link>
</image>`,
`<atom:link href="${context.site}rss.xml" rel="self" type="application/rss+xml"/>`,
].join(""),
items, items,
trailingSlash: false, trailingSlash: false,
}); });