import type { ParsedContent } from '@nuxt/content/dist/runtime/types'
import { serverQueryContent } from '#content/server'
import { asSitemapUrl, defineSitemapEventHandler } from '#imports'
export default defineSitemapEventHandler(async (e) => {
const contentList = (await serverQueryContent(e).find()) as ParsedContent[]
// console.log(contentList)
return contentList
.filter((c) => c._path.startsWith('/blog') || c._path.startsWith('/page'))
.map((c) => {
return asSitemapUrl({
loc: c._path,
// lastmod: updatedAt
})
})
})
import type { ParsedContent } from '@nuxt/content/dist/runtime/types'
import { serverQueryContent } from '#content/server'
import { asSitemapUrl, defineSitemapEventHandler } from '#imports'
export default defineSitemapEventHandler(async (e) => {
const contentList = (await serverQueryContent(e).find()) as ParsedContent[]
// console.log(contentList)
return contentList
.filter((c) => c._path.startsWith('/blog') || c._path.startsWith('/page'))
.map((c) => {
return asSitemapUrl({
loc: c._path,
// lastmod: updatedAt
})
})
})