2026-02-08 23:18:21 -05:00
|
|
|
import type { MetadataRoute } from 'next';
|
|
|
|
|
import { getAllPosts } from '@/lib/mdx';
|
|
|
|
|
|
|
|
|
|
export default function sitemap(): MetadataRoute.Sitemap {
|
|
|
|
|
const posts = getAllPosts();
|
2026-05-25 09:49:40 -04:00
|
|
|
const latestPostDate = posts[0]?.date ? new Date(posts[0].date) : undefined;
|
2026-02-08 23:18:21 -05:00
|
|
|
|
|
|
|
|
const blogEntries: MetadataRoute.Sitemap = posts.map((post) => ({
|
|
|
|
|
url: `https://akkolli.net/blog/${post.slug}`,
|
|
|
|
|
lastModified: new Date(post.date),
|
|
|
|
|
}));
|
|
|
|
|
|
|
|
|
|
return [
|
2026-05-25 09:49:40 -04:00
|
|
|
{ url: 'https://akkolli.net', lastModified: latestPostDate },
|
|
|
|
|
{ url: 'https://akkolli.net/blog', lastModified: latestPostDate },
|
|
|
|
|
{ url: 'https://akkolli.net/resume' },
|
2026-02-08 23:18:21 -05:00
|
|
|
...blogEntries,
|
|
|
|
|
];
|
|
|
|
|
}
|