Open neo-art opened 2 months ago
Unfortunately, I am not able to edit the old posts or pages. I got the following error message when I tried to access the relevant pages/posts in the Admin UI:
Field validation failed: seo: Must be a string
Any help is appreciated.
Link to the repo: https://github.com/neo-art/dante-astro-theme-2AQ.git
Any help guys? Or some workaround?
I think the problem is with the front matter of the page.
If i look at your repo some pages have this front matter
---
title: About
seo:
title: About Me
description: Learn more about the person behind the website and embark on a journey of inspiration and shared experiences.
image:
src: '/about.jpeg'
alt: A person sitting at a desk in front of a computer
---
And other:
---
title: Page test 1
description: SEO DESC
ogImage: ../../assets/images/pages/page-test-1/ogImage.jpg
---
Your config says that the seo if a relation so it should be something like this:
---
title: About
seo: test-set
---
Then a test-set.yaml should exist in your seoSchema content collection
@Matthijz98 thank you for the comment and I appreciate your taking the time to review it. Unfortunately, I couldn't get how to fix it :( The file "Page test 1" was left from previous tests and I removed it.
Anyway a few days ago I made some changes to the config (changed it to . TSX) and edited the Keystatic configuration, you can see it here: keystatic. config.tsx
Still the same error message, no matter what I try and now can't even add a new post in Keystatic admin (blank page).
I guess the problem is that I can't match the ZOD schema in Keystatic config file but not sure how to fix it. More specifically this part of Astro config.ts:
const seoSchema = z.object({
title: z.string().min(5).max(120).optional(),
description: z.string().min(15).max(160).optional(),
image: z
.object({
src: z.string(),
alt: z.string().optional()
})
.optional(),
pageType: z.enum(['website', 'article']).default('website')
});
Hello all, I am new to Keystatic and Astro and hope to get some help. I am trying to add Keystatic to an existing Astro project but I am stuck with converting the existing ZOD collections to Keystatic. This is the original theme Astro schema (config.ts):
And this is what I have done so far to the keystatic.config.ts