From 70629094071ece3cad7f55664735ad32d2dbef98 Mon Sep 17 00:00:00 2001 From: Alp Ozkan Date: Wed, 13 Sep 2023 01:31:05 +0300 Subject: [PATCH] slugs deleted --- app/blog/[slug]/page.tsx | 82 ---------------------------------------- 1 file changed, 82 deletions(-) delete mode 100644 app/blog/[slug]/page.tsx diff --git a/app/blog/[slug]/page.tsx b/app/blog/[slug]/page.tsx deleted file mode 100644 index 4797bba..0000000 --- a/app/blog/[slug]/page.tsx +++ /dev/null @@ -1,82 +0,0 @@ -import type { Metadata } from "next"; -import { notFound } from "next/navigation"; -import { allPosts } from "contentlayer/generated"; -import Date from "~/components/date"; -import Mdx from "~/components/mdx"; -import NewsletterSignup from "~/components/newsletter-signup"; - -export async function generateStaticParams() { - return allPosts.map((post) => ({ - slug: post.slug, - })); -} - -export async function generateMetadata({ - params, -}: { - params: { slug: string }; -}): Promise { - const post = allPosts.find((post) => post.slug === params.slug); - if (!post) { - return; - } - - const { title, date: publishedTime, description, slug } = post; - - return { - title, - description, - openGraph: { - title, - description, - type: "article", - publishedTime, - url: `https://www.alpozkan.info/blog/${slug}`, - }, - twitter: { - card: "summary_large_image", - title, - description, - }, - }; -} - -export default async function BlogPost({ - params, -}: { - params: { slug: string }; -}) { - const post = allPosts.find((post) => post.slug === params.slug); - - if (!post) { - notFound(); - } - - return ( -
-
-
-

- {post.title} -

-

- -

-
-
-
- {/* className="mx-auto my-8 max-w-5xl px-4 lg:my-8" */} - -
- -
- ); -}