Skip to content

Latest commit

 

History

History
48 lines (26 loc) · 3.69 KB

README.md

File metadata and controls

48 lines (26 loc) · 3.69 KB

sharing-is-caring

Some Snippet ppl might find useful as well as some guides I wrote for Sanity.io. I am also happy to help with any questions you might have. 😄

Table of Content

Document Bin - Restoring deleted documents in the studio

Learn how to setup a document bin for restoring deleted documents in Sanity.

This code is explained in the corresponding guide Create a bin for logging and restoring deleted documents. In addition to this code you will need to set up a webhook to listen for deletions and store them in the bin logs.

See Snippets

Ultimate Guide for customising Portable Text - From schema to React component 🌟

Here you will find the code to the guide Ultimate Guide for customising Portable Text - From schema to React component.

Code with comments (Sanity V3)

The code to the guide Ultimate Guide for customising Portable Text - From schema to React component. The guide leads through the all the steps you need to level-up your use of Portable Text: from setting up block content, adding custom blocks and renderers for the Portable Text Editor in your studio. It will also help you query for everything and render your awesome content in React! These examples are in Typescript, see the guide for JS. 😎 See Snippets

V2 code that still applies to V3 (with minor changes)

Customise your Studio structure with Icons and more – While keeping the code clean! (Sanity v2)

🔥 Template for singleton in pages folder 🔥

When customising your desk structure, it can be hard to keep track of all parts. This is why I split the code up in and packed it into singletons (here pages) and documentType structures, which are then imported into a deskStructure/index.js. This way your code stays readable and managable by people, especially if they have ADHD like me 😉. Structure Builder can be a bit unruly, so here you go .... See Snippets

Custom Components in your Studio GUI (Sanity v2)

Ever wondered how to use Sanity UI in your Studio GUI? Well here are some ideas! See Snippets

Portable Text glow up 💅 (Sanity V2)

Use PT and see how custom renderer can be generated for the editor in the studio as well as get GROQ queries and serializers to work in Next/React. See Snippets

Meta Solutions for Next.JS (Sanity V2)

How to systematically generate SEO/Meta information in your studio and use it in your front end. This might help you get an understanding of how to setup a working next/meta component, which you can reuse but also has a default just in case. See snippets

Feel free to contact me if you need help implementing

Not everything is polished here ... just the most important functionality is up and running and beginners might find it useful 😄