Content Schema

API Reference for DocLayer’s Content Schema

Below you can find the content schema used to define DocLayer's built-in collections. In the data model, you'll notice that we use objects named _seo, _llmSection, and _schemaOrg. The underscore prefix is used to avoid conflicts with Nuxt Content's original data model, especially for the seo field. Additionally, the _local object provides local (per-page) dynamic data that can be used along with the page content.

const optionalString = z.string().optional();export const pageCollectionSchema = (z: Zod) =>  z    .object({      title: z.string(),      description: z.string(),      _local: z.record(z.string(), z.record(z.string(), z.string())),      _seo: z        .object({          keywords: optionalString(z),          author: optionalString(z),          robots: optionalString(z),          canonical: optionalString(z),          locale: optionalString(z),          image: optionalString(z),          'og:title': optionalString(z),          'og:description': optionalString(z),          'og:image': optionalString(z),          'og:video': optionalString(z),          'og:url': optionalString(z),          'og:locale': optionalString(z),          'og:type': optionalString(z),        })        .optional(),      _schemaOrg: z        .object({          url: optionalString(z),          name: optionalString(z),          description: optionalString(z),          inLanguage: optionalString(z),        })        .optional(),    })    .required({      title: true,      description: true,    });

The collection schema and collections are delivered with the DocLayer package and can be used to extend application-based collections. Everything you need to know about defining collections can be found here.