2024-08-10 13:16:36 +00:00
|
|
|
export default defineSitemapEventHandler(async () => {
|
|
|
|
const config = useRuntimeConfig();
|
|
|
|
|
2024-08-11 07:36:56 +00:00
|
|
|
const res = await fetch(`${config.public.solarNetworkApi}/cgi/interactive/posts/minimal?take=500`)
|
2024-08-10 13:16:36 +00:00
|
|
|
const result = await res.json()
|
|
|
|
|
|
|
|
return result.data.map((item: any) => asSitemapUrl({
|
|
|
|
loc: `/posts/${item.id}`,
|
2024-08-16 08:53:23 +00:00
|
|
|
lastmod: item.edited_at ?? item.published_at,
|
2024-08-17 02:32:24 +00:00
|
|
|
priority: 0.7,
|
2024-08-10 13:16:36 +00:00
|
|
|
_sitemap: "posts",
|
|
|
|
}));
|
|
|
|
})
|