Sanity code languages definitions

import {defineField, defineType} from 'sanity';

export default defineType({
  name: 'codeLanguage',
  title: 'Code Languages',
  type: 'document',
  fields: [
    defineField({
      name: 'title',
      title: 'Title',
      type: 'string',
    }),
    defineField({
      name: 'slug',
      title: 'Slug',
      type: 'slug',
      options: {
        source: 'title',
        maxLength: 96,
      }
    }),
    defineField({
      name: 'body',
      title: 'Body',
      type: 'blockContent'
    }),
  ]
})

Want to download this example?

$ curl https://jezpoz.dev/code-examples/node/sanity-code-languages/raw > example.ts