Open Jean-Baptiste-Lasselle opened 10 months ago
Now very important, from an example :
Above :
blogCollection
, to the src/content/blog
foldersrc/content/config.ts
file, which is looked up by the astro
build: astro
expects an src/content/config.ts
file. src/content/config.ts
are one to one associated with src/content
subfolders, and for each collection defined in src/content/config.ts
, the schema defined using zod
, a typescript interface is generated in the .astro/types.d.ts
So basically, if i want pesto to generate Content Types for Astro, I need to be able to generate a Zod Schema, from a typescript interface :
So basically, the question is about generating a zod schema from a not too complex typescript interface, and apprently, that's possible according the very interesting issue https://github.com/colinhacks/zod/issues/53
It's very clear, it is collections, or more precisely cwhat astro calls "content collections" :
https://docs.astro.build/en/guides/content-collections/
there also is the equivalent of hugo's
draft: true
: if the content file name begins with an underscore, it is excluded from the astro build.