add blogs, move pictures to local + much more

This commit is contained in:
Zoe
2022-11-30 23:09:32 -06:00
parent 3b775e1eba
commit 66aa241a43
37 changed files with 4277 additions and 206 deletions

View File

@@ -0,0 +1,19 @@
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://juls07.dev'
})
for (const doc of docs) {
sitemap.write({
url: doc._path
})
}
sitemap.end()
return streamToPromise(sitemap)
})