Update something
This commit is contained in:
parent
5344e614a7
commit
90f5502efa
5 changed files with 113 additions and 4 deletions
|
@ -2,6 +2,8 @@ import rss from "@astrojs/rss";
|
|||
import { getCollection } from "astro:content";
|
||||
import getSortedPosts from "@/utils/getSortedPosts";
|
||||
import { SITE } from "@/config";
|
||||
import { globalImageUrls } from "@/utils/globalImageUrls";
|
||||
import sanitizeHtml from "sanitize-html";
|
||||
|
||||
export async function GET() {
|
||||
const posts = await getCollection("blog");
|
||||
|
@ -10,7 +12,13 @@ export async function GET() {
|
|||
title: SITE.title,
|
||||
description: SITE.desc,
|
||||
site: SITE.website,
|
||||
items: sortedPosts.map(({ data, id }) => ({
|
||||
items: sortedPosts.map(({ data, id, rendered }) => ({
|
||||
content: globalImageUrls(
|
||||
SITE.website,
|
||||
sanitizeHtml(rendered?.html, {
|
||||
allowedTags: sanitizeHtml.defaults.allowedTags.concat(["img"]),
|
||||
}),
|
||||
),
|
||||
link: `posts/${id}/`,
|
||||
title: data.title,
|
||||
description: data.description,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue