refined design
Some checks failed
Next.js App CI / docker (push) Failing after 3m19s

This commit is contained in:
2025-09-14 22:49:23 +02:00
parent 78de337446
commit 0444067c2d
89 changed files with 1117 additions and 594 deletions

61
app/sitemap.ts Normal file
View File

@@ -0,0 +1,61 @@
// app/sitemap.ts
import { getAllTags, getSortedPostsData } from '@/lib/posts';
import { MetadataRoute } from 'next';
export default function sitemap(): MetadataRoute.Sitemap {
const baseUrl = 'https://steffenillium.de';
// Improvement 1: Fetch all posts with a single, more efficient call
const allPosts = getSortedPostsData();
const postUrls: MetadataRoute.Sitemap = allPosts.map((post) => ({
url: `${baseUrl}/${post.href}`,
lastModified: new Date(post.date),
changeFrequency: 'yearly',
priority: 0.7,
}));
const allTags = getAllTags(2);
const tagUrls: MetadataRoute.Sitemap = allTags.map((tag) => ({
url: `${baseUrl}/tags/${tag.name}`,
lastModified: new Date(),
changeFrequency: 'monthly',
priority: 0.5,
}));
// The types for changeFrequency and lastModified will now be correctly inferred
const staticRoutes: MetadataRoute.Sitemap = [
{
url: baseUrl,
lastModified: new Date(),
priority: 1,
changeFrequency: 'monthly',
},
{
url: `${baseUrl}/experience`,
lastModified: new Date(),
priority: 0.8,
changeFrequency: 'monthly',
},
{
url: `${baseUrl}/research`,
lastModified: new Date(),
priority: 0.9,
changeFrequency: 'yearly',
},
{
url: `${baseUrl}/publications`,
lastModified: new Date(),
priority: 0.9,
changeFrequency: 'yearly',
},
{
url: `${baseUrl}/tags`,
lastModified: new Date(),
priority: 0.7,
changeFrequency: 'monthly',
},
];
return [...staticRoutes, ...postUrls, ...tagUrls];
}