import {defineType} from 'sanity'
export default defineType({
title: 'Content',
name: 'richText',
type: 'array',
// All possible "Blocks" that a content editor can use
options: {
sortable: true,
},
of: [
{
type: 'block',
styles: [
{title: 'Normal', value: 'normal'},
{title: 'Heading 2', value: 'h2'},
{title: 'Heading 3', value: 'h3'},
{title: 'Heading 4', value: 'h4'},
{title: 'Heading 5', value: 'h5'},
],
},
{
type: 'image',
icon: () => 'š¼ļø',
options: {hotspot: true},
fields: [
{
name: 'alt',
type: 'string',
title: 'Alternative text',
description: 'Describe the image. Important for SEO and accessiblity.',
},
{
name: 'wide',
type: 'boolean',
title: 'Wide Image?',
description: 'Makes images wider than the text column.',
initialValue: false,
},
{
name: 'background',
type: 'boolean',
title: 'Add grey background?',
description: 'Adds a grey background/border to the image.',
initialValue: false,
},
],
},
// Rest of my blocks
],
validation: (Rule) => Rule.required(),
group: 'content',
})