Files
Webserver/app/sitemap.ts
Akshay Kolli 581f888218
All checks were successful
Deploy Website / build-and-deploy (push) Successful in 8m8s
Added projects tab; first project
2026-05-25 10:05:58 -04:00

22 lines
873 B
TypeScript

import type { MetadataRoute } from 'next';
import { getAllPosts } from '@/lib/mdx';
export default function sitemap(): MetadataRoute.Sitemap {
const posts = getAllPosts();
const latestPostDate = posts[0]?.date ? new Date(posts[0].date) : undefined;
const blogEntries: MetadataRoute.Sitemap = posts.map((post) => ({
url: `https://akkolli.net/blog/${post.slug}`,
lastModified: new Date(post.date),
}));
return [
{ url: 'https://akkolli.net', lastModified: latestPostDate },
{ url: 'https://akkolli.net/projects', lastModified: new Date('2024-10-26') },
{ url: 'https://akkolli.net/projects/graph-attention-topology', lastModified: new Date('2024-10-26') },
{ url: 'https://akkolli.net/blog', lastModified: latestPostDate },
{ url: 'https://akkolli.net/resume' },
...blogEntries,
];
}