add TOC add better blog navigation and a new blog post

This commit is contained in:
Zoe
2024-04-23 18:33:05 -05:00
parent df52d24242
commit 2e75732908
27 changed files with 2530 additions and 10686 deletions

View File

@@ -2,19 +2,19 @@ import { serverQueryContent } from '#content/server'
import { SitemapStream, streamToPromise } from 'sitemap'
export default defineEventHandler(async (event) => {
// Fetch all documents
const docs = await serverQueryContent(event).where({ _draft: false }).find()
const sitemap = new SitemapStream({
hostname: 'https://juls07.dev'
})
for (const doc of docs) {
sitemap.write({
url: doc._path,
changefreq: 'monthly'
// Fetch all documents
const docs = await serverQueryContent(event).where({ _draft: false }).find()
const sitemap = new SitemapStream({
hostname: 'https://juls07.dev'
})
}
sitemap.end()
return streamToPromise(sitemap)
for (const doc of docs) {
sitemap.write({
url: doc._path,
changefreq: 'monthly'
})
}
sitemap.end()
return streamToPromise(sitemap)
})