Last active
April 17, 2025 02:26
-
-
Save cupofcrazy/41cd1f7423c4f7f2634c806c8df79a2c to your computer and use it in GitHub Desktop.
Personal reusable Sanity schema types (WIP)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // A11Y Image with alt | |
| const a11yImage = defineType({ | |
| name: 'a11yImage', | |
| title: 'A11y Image', | |
| type: 'object', | |
| fields: [ | |
| defineField({ | |
| name: 'shot', | |
| title: 'Shot', | |
| type: 'image', | |
| options: { | |
| hotspot: true, | |
| }, | |
| }), | |
| defineField({ | |
| name: 'alt', | |
| title: 'Alt', | |
| type: 'string', | |
| }), | |
| ], | |
| }); | |
| // SEO Schema: title, description, Open Graph Image | |
| export default defineType({ | |
| name: 'seo', | |
| title: 'SEO', | |
| type: 'object', | |
| fields: [ | |
| defineField({ | |
| name: 'seoTitle', | |
| title: 'Title', | |
| type: 'string', | |
| }), | |
| defineField({ | |
| name: 'seoDescription', | |
| title: 'Description', | |
| type: 'text', | |
| }), | |
| defineField({ | |
| name: 'ogImage', | |
| title: 'OG Image', | |
| type: 'image', | |
| options: { | |
| hotspot: true, | |
| }, | |
| }), | |
| ], | |
| }); | |
| // Video schema feat. Mux Video | |
| export default defineType({ | |
| name: "video", | |
| title: "Video", | |
| type: "object", | |
| fields: [ | |
| defineField({ | |
| name: 'caption', | |
| title: 'Caption', | |
| type: 'string', | |
| }), | |
| defineField({ | |
| name: 'clip', | |
| title: 'Clip', | |
| type: 'mux.video', | |
| }), | |
| ], | |
| }); | |
| // |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment