initial commit: project completion with proper gitignore
This commit is contained in:
29
app/works/[slug]/page.tsx
Normal file
29
app/works/[slug]/page.tsx
Normal file
@@ -0,0 +1,29 @@
|
||||
import { getProjectBySlug } from "@/app/actions";
|
||||
import WorkDetailClient from "@/components/WorkDetailClient";
|
||||
import { notFound } from "next/navigation";
|
||||
import { Metadata } from "next";
|
||||
|
||||
export async function generateMetadata({ params }: { params: Promise<{ slug: string }> }): Promise<Metadata> {
|
||||
const { slug } = await params;
|
||||
const data = await getProjectBySlug(slug);
|
||||
if (!data) return {};
|
||||
|
||||
const { project } = data;
|
||||
return {
|
||||
title: project.title,
|
||||
description: project.subtitle,
|
||||
openGraph: {
|
||||
title: `${project.title} | Muğla Dijital`,
|
||||
description: project.subtitle,
|
||||
images: [project.hero_image],
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
export default async function ProjectDetailPage({ params }: { params: Promise<{ slug: string }> }) {
|
||||
const { slug } = await params;
|
||||
const data = await getProjectBySlug(slug);
|
||||
if (!data) notFound();
|
||||
|
||||
return <WorkDetailClient project={data.project} nextProject={data.nextProject} />;
|
||||
}
|
||||
24
app/works/page.tsx
Normal file
24
app/works/page.tsx
Normal file
@@ -0,0 +1,24 @@
|
||||
import sql from "@/lib/db";
|
||||
import WorksClient from "@/components/WorksClient";
|
||||
import { Metadata } from "next";
|
||||
|
||||
export async function generateMetadata(): Promise<Metadata> {
|
||||
return {
|
||||
title: "Çalışmalarımız",
|
||||
description: "Muğla Dijital olarak hayata geçirdiğimiz seçkin projeleri, sosyal medya kampanyalarını ve dijital pazarlama başarı hikayelerini inceleyin.",
|
||||
alternates: {
|
||||
canonical: "/works",
|
||||
},
|
||||
openGraph: {
|
||||
title: "Çalışmalarımız | Muğla Dijital",
|
||||
description: "Markalar için yarattığımız dijital başarı hikayeleri.",
|
||||
url: "https://mugladijitalmedya.com/works",
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
export default async function WorksPage() {
|
||||
const projects = await sql`SELECT * FROM projects ORDER BY created_at DESC`;
|
||||
|
||||
return <WorksClient projects={projects || []} />;
|
||||
}
|
||||
Reference in New Issue
Block a user