diff --git a/src/src/pages/blog/[...slug].astro b/src/src/pages/blog/[...slug].astro index 362438a..a0747c9 100644 --- a/src/src/pages/blog/[...slug].astro +++ b/src/src/pages/blog/[...slug].astro @@ -2,28 +2,21 @@ import { CollectionEntry, getCollection } from "astro:content"; import { Image } from "astro:assets"; import BlogLayout from "@/layouts/blog.astro"; - -import { Image } from "astro:assets"; -import { getCollection } from "astro:content"; -import type { CollectionEntry } from "astro:content"; import { getArticleSchema } from "@/lib/structuredData"; import { blogWebsite } from "@/lib/structuredData"; interface Props { post: CollectionEntry<"blog">; } - export async function getStaticPaths() { - const posts = await getCollection("blog"); - return posts.map((post) => ({ - params: { slug: post.slug }, - props: post, - })); + const posts = await getCollection("blog"); + return posts.map((post) => ({ + params: { slug: post.slug }, + props: post, + })); } - const post = Astro.props; const { Content } = await post.render(); - const articleStructuredData = getArticleSchema(post); const breadcrumbsStructuredData = { @@ -44,7 +37,6 @@ const breadcrumbsStructuredData = { }, ], }; - const jsonLd = { "@context": "https://schema.org", "@graph": [articleStructuredData, breadcrumbsStructuredData, blogWebsite], @@ -53,12 +45,33 @@ const jsonLd = {