From 3e062f503295bc6ea1be79b50d3b754387dbacfa Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Wed, 12 Feb 2025 15:37:47 +0000 Subject: [PATCH] fix: update TinaCMS configuration and blog page types Co-Authored-By: G --- app/blog/[slug]/page.tsx | 9 +++++++-- tina/config.ts | 25 +++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/app/blog/[slug]/page.tsx b/app/blog/[slug]/page.tsx index 16969dc..e4225ef 100644 --- a/app/blog/[slug]/page.tsx +++ b/app/blog/[slug]/page.tsx @@ -1,5 +1,4 @@ import { TinaMarkdown } from 'tinacms/dist/rich-text'; -import { tinaField } from "tinacms/dist/react"; // For development, we'll use static data until TinaCMS is fully configured export async function generateStaticParams() { @@ -21,7 +20,13 @@ export default async function BlogPost({ params }: { params: { slug: string } }) {new Date(post.date).toLocaleDateString()}
-
{post._body}
+
); diff --git a/tina/config.ts b/tina/config.ts index 8816f7c..ea1bfd0 100644 --- a/tina/config.ts +++ b/tina/config.ts @@ -8,6 +8,31 @@ export default defineConfig({ outputFolder: "admin", publicFolder: "public", }, + schema: { + collections: [ + { + name: "post", + label: "Blog Posts", + path: "content/posts", + format: "mdx", + fields: [ + { + type: "string", + name: "title", + label: "Title", + isTitle: true, + required: true, + }, + { + type: "rich-text", + name: "body", + label: "Body", + isBody: true, + }, + ], + }, + ], + }, media: { tina: { mediaRoot: "uploads",