This is from my Smashing magazine article on creating your own SSG For full details on creating this, read the article.
To get the site up and running:
cd site
npm install
npm run dev
To get the Studio up and running:
- Install the Sanity CLI
npm install -g @sanity/cli
- Connect
/studio/
to your Sanity account and project
cd studio
sanity init
- Install and serve
npm install
sanity start
- Connect your Sanity project to the site by opening
/site/utils/SanityClient.js
and replacingprojectId
anddataset
with the correct information created by the Sanity CLI.
Install from sanity.io/create
Want a 1-click installer? This Starter link will give you the code, initialize the Studio, and deploy both to Netlify.