Stelly's Gatsby + Sanity Starter
This is a simple starter repo for bootstrapping Gatsby and Sanity.io projects
Getting Started:
git clone https://github.com/stelly-dev/starter-gatsby-sanity.git
cd starter-gatsby-sanity/studio
sanity init
- select
Create new Project
- select
Clean Project with no predefined Schemas
- Go to sanity.io and create a new token.
- edit
starter-gatsby-sanity/web/.env-example
and fill out the fields - start adding schemas in
starter-gatsby-sanity/studio/schemas/
- ???
- PROFIT
Wait I forgot how to schema!
No worries, I gotchu. -- here's a quick example.
// blogPost.js
export default {
name: 'blogPost',
title: 'Blog Post',
type: 'document',
fields: [
{
name: 'author',
title: 'Author',
type: 'string',
},
// ... now you try! ...
],
};
then import them into starter-gatsby-sanity/studio/schemas/schema.js
(don't forget to add to the schemaTypes.concat([...])
export.