Coder Social home page Coder Social logo

sanity-kitchen-sink's Introduction

The Kitchen Sink Studio

A “kitchen sink” is a showcase of APIs and functionality. This is the example project that we at Sanity HQ use for demos. Hence, it will change and evolve over time with new feature releases.

This starter is great for demo purposes, either to evaluate Sanity for your own use, or when you want to offer it as part of a project for your clients.

Because this starter is used for demo purposes, you will find that not all fields in the Studio has been wired up to the example frontend. This is not intented for use in production.

You can bootstrap a new project from this template by following this link to sanity.io/create.

What you have

Concepts covered in this starter are:

  • How to use the Studio‘s page builder to create landing pages, and present them in a web frontend
  • Edit blog posts with side-by-side web-previews, can be configured to Gatsby Preview for real-time previewing in production and not just local development
  • How to manage SEO metadata like fields for Open Graph meta-tags
  • How to set up navigation for structured content, which allows for proper decoupling and omni-channel
  • Custom embedded objects in rich text for Instagram posts, social media videos, LaTeX math etc.
  • Field validations
  • Custom slugify functions with promises
  • Examples of how to use plugins and custom input components
  • Examples of custom document and document type lists using structure builder
  • Custom asset sources for Unsplash and AI-generated person photos
  • …and more

Technologies:

  • A blazing frontend of landing pages and a blog with Gatsby.js
  • Structured content using Sanity.io
  • Global deployment on Netlify

Quick start

  1. Clone this repository
  2. npm install in the project root folder on local
  3. npm run dev to start the studio and frontend locally
  4. npm run build to build to production locally

Enable real-time content preview on development

  1. Go to your project’s API settings on manage.sanity.io and create a token with read rights.
  2. Rename .env.development.template to .env.development and paste in the token: SANITY_READ_TOKEN="yourTokenHere".
  3. Restart the development server (ctrl + C and npm run dev).

If you want to turn off preview you can set watchMode: false in gatsby-config.js. If you just want to preview published changes you can set overlayDrafts: false in gatsby-config.js.

Enable real-time preview outside of development

In order to have live previewing available outside of the npm run dev cycle you will have to set it up yourself.

The easiest way would be to utilize Gatsby Cloud. This will give you a deployment of the Gatsby web app set up to provide the same live preview as you have locally. A guide for setting this up can be found at https://www.gatsbyjs.com/docs/sanity/getting-started/. Note that this is a paid service from Gatsby.

For the 'Web preview' tabs in the Studio editors to work with a remote live preview instance, please remember to update the baseUrl value in studio/resolvePreviewUrl.js.

Should you want to host Gatsby in live preview yourself we have also included a Dockerfile and (.dockerignore) as a starting point in the web/ folder. Deploying that container is outside the scope of this example. There are many guides online on how to do that.

Deploy changes

Netlify automatically deploys new changes commited to master on GitHub. If you want to change deployment branch, do so in build & deploy settings on Netlify.

Stuck? Get help

Slack Community Button

Join Sanity’s developer community or ping us on twitter.

sanity-kitchen-sink's People

Watchers

Dr Gareth Roberts avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.