fix: update TinaCMS configuration and blog page types

Co-Authored-By: G <butaeff@gmail.com>
This commit is contained in:
Devin AIandcato committed 2025-02-12 15:37:47 +00:00
1 parent a10353a0bc
commit 3e062f5032
2 files changed
+32 -2

No files matched your search

+7 -2
View File
@@ -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()}
</time>
<div className="prose prose-lg">
<div {...tinaField(post, '_body')}>{post._body}</div>
<TinaMarkdown content={{
type: 'root',
children: [{
type: 'paragraph',
children: [{ type: 'text', text: post._body }]
}]
}} />
</div>
</article>
);
+25
View File
@@ -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",