Enhance blog metadata and SEO with structured Open Graph data; add sitemap and robots.txt functionality; replace default OG image.
All checks were successful
Build and Deploy Blog / build-and-deploy-local (push) Successful in 36s

This commit is contained in:
2025-09-04 00:05:22 +02:00
parent a475d8a5fb
commit 8314a2a328
5 changed files with 65 additions and 2 deletions

26
app/sitemap.tsx Normal file
View File

@@ -0,0 +1,26 @@
import { MetadataRoute } from "next";
import { getSortedPostsData } from "@/lib/posts";
export default function sitemap(): MetadataRoute.Sitemap {
const baseUrl = "https://blog.gabrielkaszewski.dev";
const posts = getSortedPostsData();
const postUrls = posts.map((post) => ({
url: `${baseUrl}/${post.id}`,
lastModified: new Date(post.date).toISOString(),
changeFrequency: "monthly" as const,
priority: 0.8,
}));
const staticUrls = [
{
url: baseUrl,
lastModified: new Date().toISOString(),
changeFrequency: "weekly" as const,
priority: 1.0,
},
];
return [...staticUrls, ...postUrls];
}