James Singleton
Senior Software Engineer at Zendesk
James is located at Arizona
This can be used for blogs or articles where you want to possibly display next and previous article buttons
*[_type == "post" && slug.current == $slug]{
"currentPost": {
title
},
"previousPost": *[_type == "post" && ^.publishedAt > publishedAt]|order(publishedAt desc)[0]{title,"slug": slug.current},
"nextPost": *[_type == "post" && ^.publishedAt < publishedAt]|order(publishedAt asc)[0]{title,"slug": slug.current},
"morePosts": *[_type == "post" && slug.current != $slug] | order(publishedAt desc, _updatedAt desc)[0...3] {
${postFields}
}
}|order(publishedAt)[0]
Senior Software Engineer at Zendesk
Knut is a principal developer marketing manager at Sanity.io
If you want to pass a parameter to a query that might not always be defined
Go to Handle Certain Values To Be TrueHow to automatically generate linked headings with a custom serializer
Go to Anchored Headings for Portable TextMigration script to convert plain text to block content across your content lake
Go to Migrate plain text field to Portable Text