feat: make markdown work

dear lord
This commit is contained in:
2022-07-22 15:32:00 -04:00
parent 9c6b91c562
commit 92d0d70760
15 changed files with 262 additions and 134 deletions

View File

@@ -0,0 +1,13 @@
import { serverQueryContent } from "#content/server";
import { SitemapStream, streamToPromise } from "sitemap";
export default defineEventHandler(async (event) => {
// Fetch all documents
const docs = await serverQueryContent(event).find();
const sitemap = new SitemapStream({ hostname: "https://eggworld.tk" });
for (const doc of docs) {
sitemap.write({ url: doc._path, changefreq: "monthly" });
}
sitemap.end();
return streamToPromise(sitemap);
});