adding sanity components
This commit is contained in:
57
schemas/documents/blogs.ts
Normal file
57
schemas/documents/blogs.ts
Normal file
@@ -0,0 +1,57 @@
|
||||
import {ComposeIcon} from '@sanity/icons'
|
||||
|
||||
export default {
|
||||
name: 'blogs',
|
||||
title: 'Blogs',
|
||||
type: 'document',
|
||||
icon: ComposeIcon,
|
||||
fields: [
|
||||
{
|
||||
name: 'title',
|
||||
title: 'Title',
|
||||
type: 'string',
|
||||
},
|
||||
{
|
||||
name: 'slug',
|
||||
title: 'Slug',
|
||||
type: 'slug',
|
||||
options: {
|
||||
source: 'title',
|
||||
maxLength: 96,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'description',
|
||||
title: 'Description',
|
||||
type: 'text',
|
||||
description: 'Enter a short snippit of the blog'
|
||||
},
|
||||
{
|
||||
name: 'mainImage',
|
||||
title: 'Main Image',
|
||||
type: 'image',
|
||||
options: [
|
||||
{
|
||||
hotspot: true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: 'Categories',
|
||||
title: 'categories',
|
||||
type: 'array',
|
||||
of: [{type: 'reference', to: {type: 'categories'}}]
|
||||
},
|
||||
{
|
||||
name: 'publishedAt',
|
||||
title: 'Published at',
|
||||
type: 'datetime'
|
||||
},
|
||||
{
|
||||
name: 'body',
|
||||
title: 'Body',
|
||||
type: 'blockContent'
|
||||
}
|
||||
|
||||
],
|
||||
}
|
||||
Reference in New Issue
Block a user