Created
July 12, 2020 23:00
-
-
Save 3200pro/d14f176b2b4470e3ee46e0f65b08b3f7 to your computer and use it in GitHub Desktop.
Sanity CMS Figure Schema
This file contains 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
export default { | |
name: "figure", | |
title: "Image", | |
type: "image", | |
options: { | |
hotspot: true, | |
}, | |
fields: [ | |
{ | |
title: "Caption", | |
name: "caption", | |
description: "Leave blank if you do not want a caption", | |
type: "string", | |
options: { | |
isHighlighted: true, | |
}, | |
}, | |
{ | |
name: "alt", | |
type: "string", | |
title: "Alternative text", | |
validation: Rule => | |
Rule.error("You have to fill out the alternative text.").required(), | |
description: "Important for SEO and accessiblity.", | |
options: { | |
isHighlighted: true, | |
}, | |
}, | |
{ | |
title: 'Disable GatsbyImage', | |
name: 'disableGatsbyImage', | |
type: 'boolean', | |
}, | |
], | |
preview: { | |
select: { | |
imageUrl: "asset.url", | |
title: "alt", | |
}, | |
}, | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment