adding sanity components

This commit is contained in:
briannelson95
2025-09-30 19:40:25 -04:00
parent 3c0e27d7f2
commit f016b39e5c
32 changed files with 3062 additions and 8 deletions

View File

@@ -0,0 +1,43 @@
import MyPreviewComponent from '@/components/MyPreviewComponent';
import { defineField, defineType } from 'sanity';
export const newsPost = defineType({
name: 'newsPost',
title: 'News Posts',
type: 'document',
fields: [
defineField({
name: 'title',
title: 'Title',
type: 'string'
}),
defineField({
name: 'slug',
title: 'Slug',
type: 'slug',
options: {
source: 'title',
maxLength: 96
}
}),
defineField({
name: 'image',
type: 'reference',
to: {
type: 'media',
components: {
preview: MyPreviewComponent
}
},
}),
defineField({
name: 'previewText',
title: 'Preview Text',
type: 'text'
}),
defineField({
name: 'category',
type: 'string'
})
],
})