James Singleton
Senior Software Engineer at AmEx
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 AmEx
Knut is a principal developer marketing manager at Sanity.io
Automatically track when content was first published with a timestamp that sets once and never overwrites, providing reliable publication history for analytics and editorial workflows.
Go to First Published Timestamp FunctionAI-powered automatic tagging for Sanity blog posts that analyzes content to generate 3 relevant tags, maintaining consistency by reusing existing tags from your content library.
Go to Automatically tag blog postsIf you want to pass a parameter to a query that might not always be defined
Go to Handle Certain Values To Be True