Sanity is a headless CMS – basically a database for content where you can easily change the schemas (and more). You get a content studio out of the box, which you can open in the browser to edit content. Sanity also has a nice API that you can use to query your content in other applications.
Here is how you can quickly create a new Sanity project, creating a CMS for your own CV, and displaying that content in your version of the client.
- Create a new Sanity project for your CV at manage.sanity.io. (You can let the dataset be "Public (world readable)".)
- Search for
dyub8zvy
and replace with the project id of your new project. (Your project id should be listed on the front page of your project atmanage.sanity.io/projects/<project-id>
, as well as in the URL. There is a match fordyub8zvy
in sanity.json, client/src/sanity.js, and in migration-scripts/sanity.js). - Add sample content to your studio
If you already started your client, just refresh localhost:3000 and you should now see the sample CV instead of the CV for Arne Mæhlum.
To edit the contents, you can now run the content studio locally, or deploy it to production.
The content studio is where you edit the content stored in your CMS.
- Install Sanity CLI globally:
$ npm install -g @sanity/cli
- Install dependencies in this directory:
$ npm install
If you want, you can add some sample content to your content studio.
- In this directory, run
$ sanity dataset import sample-CV.tar.gz production
.
- PS: If you haven't done so already, first install dependencies as described above.
While develping, you might want to make changes to the schemas. Then it's handy to run the content studio locally, which will hot reload whenever you do.
$ npm start
- Browse the content studio at localhost:3333.
- PS: If you haven't done so already, first install dependencies as described above.
To make your content studio available at <project-name>.sanity.studio
, you need to deploy the content studio to production.
- In this directory, run
$ sanity deploy
- PS: If you haven't done so already, first install dependencies as described above.
Sanity has created their own query language, GROQ, which resembles GraphQL. In this project, data is queried in personStore.