Update dependencies and improve build performance

This commit is contained in:
Bad Manners 2024-07-24 14:22:00 -03:00
parent 688f9b982d
commit f8ac450ab5
6 changed files with 1600 additions and 1715 deletions

View file

@ -1,10 +1,10 @@
import rss, { type RSSFeedItem } from "@astrojs/rss";
import type { APIRoute } from "astro";
import { getCollection, type CollectionEntry } from "astro:content";
import { markdown } from "@astropub/md";
import sanitizeHtml from "sanitize-html";
import { t } from "../i18n";
import type { Lang } from "../content/config";
import { markdownToHtml } from "../utils/markdown_to_html";
import { markdownToPlaintext } from "../utils/markdown_to_plaintext";
type FeedItem = RSSFeedItem & {
@ -73,8 +73,8 @@ export const GET: APIRoute = async ({ site }) => {
? `<p>${t(data.lang, "export_story/commissioned_by", getLinkForUser(users.find((user) => user.id === data.commissioner!.id)!, data.lang))}</p>`
: "") +
`<hr><p><em>${t(data.lang, "story/warnings", data.wordCount, data.contentWarning.trim())}</em></p>` +
`<hr>${markdownToHtml(body)}` +
`<hr>${markdownToHtml(data.description)}`,
`<hr>${await markdown(body)}` +
`<hr>${await markdown(data.description)}`,
),
})),
),
@ -104,8 +104,8 @@ export const GET: APIRoute = async ({ site }) => {
)}</p>` +
`<hr><p>${t(data.lang, "game/platforms", data.platforms)}</p>` +
`<hr><p><em>${data.contentWarning.trim()}</em></p>` +
`<hr>${markdownToHtml(body)}` +
`<hr>${markdownToHtml(data.description)}`,
`<hr>${await markdown(body)}` +
`<hr>${await markdown(data.description)}`,
),
})),
),