diff --git a/apps/marketing/src/app/blog/[postSlug]/layout.tsx b/apps/marketing/src/app/blog/[postSlug]/layout.tsx index c576fc9..38aef72 100644 --- a/apps/marketing/src/app/blog/[postSlug]/layout.tsx +++ b/apps/marketing/src/app/blog/[postSlug]/layout.tsx @@ -1,13 +1,44 @@ import React from "react"; +import { Metadata } from "next"; +import { notFound } from "next/navigation"; import { CallToAction } from "@/components/call-to-action"; +import { getAllPosts, getPostBySlug } from "@/lib/posts"; import { siteConfig } from "@/config"; interface PostLayoutProps { + params: { + postSlug: string; + }; children: React.ReactNode; } const config = siteConfig.pricingPage; +export async function generateMetadata({ params }: PostLayoutProps): Promise { + const post = getPostBySlug(params.postSlug); + if (!post) { + notFound(); + } + return { + title: post.metadata.title, + description: post.metadata.summary, + keywords: post.metadata.keywords, + openGraph: { + title: post.metadata.title, + description: post.metadata.summary, + images: post.metadata.thumbnail ? [post.metadata.thumbnail] : undefined, + }, + }; +} + +export async function generateStaticParams() { + const posts = getAllPosts(); + + return posts.map((post) => ({ + postSlug: post.slug, + })); +} + const PostLayout = (props: PostLayoutProps) => { const { children } = props; return ( diff --git a/apps/marketing/src/app/blog/[postSlug]/page.tsx b/apps/marketing/src/app/blog/[postSlug]/page.tsx index 46faabc..b8e23e6 100644 --- a/apps/marketing/src/app/blog/[postSlug]/page.tsx +++ b/apps/marketing/src/app/blog/[postSlug]/page.tsx @@ -1,36 +1,8 @@ -import { Metadata } from "next"; import { notFound } from "next/navigation"; import { Badge } from "@turbocharger/ui"; import { formatDate } from "@turbocharger/utils"; import { MDX } from "@/components/mdx"; -import { getAllPosts, getPostBySlug } from "@/lib/posts"; - -export async function generateMetadata({ params }: PostPageProps): Promise { - const post = getPostBySlug(params.postSlug); - if (!post) { - notFound(); - } - return { - title: post.metadata.title, - description: post.metadata.summary, - keywords: post.metadata.keywords, - openGraph: { - title: post.metadata.title, - description: post.metadata.summary, - images: post.metadata.thumbnail ? [post.metadata.thumbnail] : undefined, - }, - }; -} - -export async function generateStaticParams() { - const posts = getAllPosts(); - - return posts.map((post) => ({ - params: { - postSlug: post.slug, - }, - })); -} +import { getPostBySlug } from "@/lib/posts"; interface PostPageProps { params: { diff --git a/apps/marketing/src/app/blog/page.tsx b/apps/marketing/src/app/blog/page.tsx index 3cd0eb9..9d9749a 100644 --- a/apps/marketing/src/app/blog/page.tsx +++ b/apps/marketing/src/app/blog/page.tsx @@ -12,7 +12,6 @@ export const metadata: Metadata = { export default async function BlogPage() { const posts = getAllPosts(); - console.log(posts); return (
diff --git a/apps/marketing/src/components/hero.tsx b/apps/marketing/src/components/hero.tsx index 7ec503e..dc5d3a9 100644 --- a/apps/marketing/src/components/hero.tsx +++ b/apps/marketing/src/components/hero.tsx @@ -24,7 +24,7 @@ export const Hero = (props: HeroProps) => { const { headline, subheadline, cta, demoVideo, companies } = props; return (
-

+

{headline.split("\n").map((line, index) => ( {stringReplace(line, /\*\*(.*?)\*\*/g, (match, index) => (