Skip to content

Commit

Permalink
feat: preview slugs on posts
Browse files Browse the repository at this point in the history
  • Loading branch information
p5quared committed Nov 25, 2024
1 parent 506a874 commit 3f46571
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion studio/schemas/posts.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,19 @@ export default {
title: 'Post',
name: 'post',
type: 'document',
preview: {
select: {
title: 'title',
subtitle: 'slug',
},
prepare(selection) {
const {title, subtitle} = selection
return {
title: title,
subtitle: subtitle ? '/' + subtitle.current : 'No slug'
}
}
},
fields: [
{
title: 'Title',
Expand Down Expand Up @@ -73,5 +86,4 @@ export default {
}

]

}

0 comments on commit 3f46571

Please sign in to comment.