seo: sitemap, robots, og tags

This commit is contained in:
2025-08-06 22:38:22 +01:00
parent 1e0cca1ef3
commit 8544efb5bf
5 changed files with 172 additions and 10 deletions

View File

@@ -1,13 +1,39 @@
import type { Metadata } from "next";
import { getPattern, getQuestions } from "@/lib/api";
import { QuestionCard } from "@/components/questions/question-card";
import { Card, CardHeader, CardTitle, CardContent } from "@/components/ui/card";
import { notFound } from "next/navigation";
export default async function PatternDetailPage({
params,
}: {
interface PageProps {
params: Promise<{ slug: string }>;
}) {
}
export async function generateMetadata({ params }: PageProps): Promise<Metadata> {
const { slug } = await params;
try {
const pattern = await getPattern(slug);
const description =
pattern.description ||
`Learn the ${pattern.name} pattern with ${pattern.question_count} practice problems.`;
return {
title: `${pattern.name} Pattern`,
description,
openGraph: {
title: `${pattern.name} Pattern | CodeTutor`,
description,
type: "article",
},
};
} catch {
return {
title: "Pattern Not Found",
};
}
}
export default async function PatternDetailPage({ params }: PageProps) {
const { slug } = await params;
let pattern;