diff --git a/apps/website/src/app/blog/[slug]/page.tsx b/apps/website/src/app/blog/[slug]/page.tsx index 52f315d..7447e2c 100644 --- a/apps/website/src/app/blog/[slug]/page.tsx +++ b/apps/website/src/app/blog/[slug]/page.tsx @@ -2,10 +2,10 @@ import { format } from "date-fns"; import { CalendarDays, Clock, User } from "lucide-react"; import { groq } from "next-sanity"; import readingTime from "reading-time"; -import { Article, WithContext } from "schema-dts"; import { z } from "zod"; import { ArticleHeader } from "../../../components/ArticleHeader/ArticleHeader"; import { MDXContent } from "../../../components/MDXContent/MDXContent"; +import { StructuredData } from "../../../components/StructuredData/StructuredData"; import { Container } from "../../../design-system/Container/Container"; import { createGenerateMetadata, ogImage } from "../../../lib/metadata"; import { queryContent } from "../../../lib/sanity"; @@ -29,7 +29,7 @@ export const generateMetadata = createGenerateMetadata(async ({ params }) => { summary: z.string().nullable(), image: z.string(), content: z.string(), - }) + }), ); const stats = readingTime(content); @@ -80,8 +80,8 @@ export const generateStaticParams = async () => { z.array( z.object({ slug: z.string(), - }) - ) + }), + ), ); return blogPosts.map((blogPost) => ({ @@ -129,53 +129,50 @@ const BlogPostPage = async ({ params }: Props) => { .array( z.object({ title: z.string(), - }) + }), ) .nullable(), topics: z .array( z.object({ title: z.string(), - }) + }), ) .nullable(), content: z.string(), - }) + }), ); const stats = readingTime(blogPost.content); - - const jsonLd: WithContext
= { - "@context": "https://schema.org", - "@type": "Article", - mainEntityOfPage: { - "@type": "BlogPosting", - "@id": `https://katharinaclasen.com/blog/${blogPost.slug}`, - }, - headline: blogPost.title, - image: [blogPost.image.url], - datePublished: blogPost.date, - dateModified: blogPost.date, - author: { - "@type": "Person", - name: "Katharina Clasen", - }, - publisher: { - "@type": "Organization", - name: "Katharina Clasen", - logo: { - "@type": "ImageObject", - url: "/favicon.png", - }, - }, - description: blogPost.summary || "Blog post by Katharina Clasen", - }; return ( <> -