Files
Webserver/app/sitemap.ts
Akshay Kolli 9bcbf3b20e
All checks were successful
Deploy Website / build-and-deploy (push) Successful in 26s
Add I Hate PDFs app pages
2026-06-21 20:20:32 -07:00

25 lines
1.1 KiB
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/inspire-me', lastModified: new Date('2026-06-19') },
{ url: 'https://akkolli.net/ihatepdfs', lastModified: new Date('2026-06-21') },
{ url: 'https://akkolli.net/ihatepdfs/privacy', lastModified: new Date('2026-06-21') },
{ url: 'https://akkolli.net/resume' },
...blogEntries,
];
}