Raw blog finished
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
import type { ParsedContent } from '@nuxt/content/dist/runtime/types'
|
||||
import { formatDate } from 'date-fns'
|
||||
|
||||
import { serverQueryContent } from '#content/server'
|
||||
|
||||
export default defineSitemapEventHandler(async (e) => {
|
||||
const contentList = (await serverQueryContent(e).find()) as ParsedContent[]
|
||||
return contentList.map((c) => {
|
||||
return asSitemapUrl({
|
||||
loc: c._path,
|
||||
lastmod: formatDate(c.updated, 'yyyy-MM-dd'),
|
||||
changefreq: 'monthly',
|
||||
priority: 0.9,
|
||||
})
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user