fix: fix rss content

This commit is contained in:
Guoqi Sun 2024-12-23 02:07:33 +08:00
parent 349ba14439
commit 3bd4752bfd

View file

@ -1,5 +1,4 @@
import rss from "@astrojs/rss" import rss from "@astrojs/rss"
import sanitizeHtml from "sanitize-html"
import { zh as config } from "~/config" import { zh as config } from "~/config"
import { getPostsByLocale } from "~/utils" import { getPostsByLocale } from "~/utils"
@ -18,7 +17,7 @@ export async function GET() {
description: post.data.description, description: post.data.description,
pubDate: post.data.pubDate, pubDate: post.data.pubDate,
link: `/posts/${post.id}/`, link: `/posts/${post.id}/`,
content: sanitizeHtml(post.body), content: post.rendered ? post.rendered.html : post.data.description,
})), })),
customData: "", customData: "",
}) })