A portfolio using structured content and a static site builder.
Deployed from sanity.io/create.
- A blazing fast portfolio with Gatsby.js
- Structured content using Sanity.io
- Global deployment on Netlify
- Clone this repository from your GitHub account
yarn install
in the project root folder on localyarn run dev
to start the Studio and frontend locally **- Your Studio should be running on http://localhost:3333
- Your frontend should be running on http://localhost:8000
yarn run build
to build to production locally ** Note: You may have better success opening two separate terminals to and runningyarn run dev
in both/studio
and/web
- Having troucble with
yarn install
? Verified Node versions:14.xx
,17.xx
Steps
-
Use
local
machine to create document on your personal tagged dataset (Commit for reference on how to switch to change tags) -
Export from your tagged dataset, then import into the
dev
dataset using either--missing
or--replace
flags (Documentation) -
In the
dev
dataset, then add content to your new document in the Sanity Dashboard -
Then export from the
dev
dataset, and import into theproduction
dataset using the--missing skip
flag (adds any missing data, skips any data with same Id's) -
Possible have to do
sanity graphql deploy
to update the GraphQL (After adding code in `/documents)) -
Yay you're done... hopefully (Refer to the commands below)
-
- Note: these commands will only transfer the content of the documents, you will still need to add the document code to the
studio/douments
folder
- Note: these commands will only transfer the content of the documents, you will still need to add the document code to the
These 2 commands will export from your tagged
dataset into the dev
dataset
sanity dataset export dev --tag [tagName] ./tagged.tar.gz
(Export fromtagged
dataset)sanity dataset import ./tagged.tar.gz dev --missing skip
(Import intodev
dataset) this will add all missing data and skip any data with the same id
After this step, you would populate the content in sanity
Then, these 2 commands will import your data from dev
to production
sanity dataset export dev ./dev.tar.gz
(Export fromdev
dataset) Create a backup ofproduction
dataset (Possible GitHub action)sanity dataset export production ./production.tar.gz
(Export fromproduction
dataset)
Import from dev
into production
sanity dataset import ./dev.tar.gz production --missing skip
(Import intoproduction
dataset)
Sanity runs into issues with overwriting work when trying to update schemas simultaneously on different branches. The ideal workflow for updating schema is as follows:
-
Plan out all necessary schema for development.
-
Add schema and push to the main branch on Github before any changes are made by other users.
-
Other users should pull your schema changes before adding any new schema.
-
Continue development on the front-end accessing the already committed schema.
The entire goal is to eliminate concurrent development of Sanity schema since they will overwrite each other.
Other potential solutions:
- Sanity migration command