Sanity.io
Getting Started
We have built a starter project to make it super easy creating a new website with a sanity.io back-end. Getting a new project up and ready is as simple as
Connecting a CMS Manually
When ready, you can connect a headless CMS of your choice. Currently, only Sanity.io is supported. To connect sanity make sure sanity-cli
is installed and run:
This will create a folder named sanity-studio where we have our sanity studio project with the OnlyHtml plugin installed. The next step will be to configure Sanity and OnlyHtml, first edit<your-site>/sanity-studio/sanity.json
and put an empty array in the parts
field. This is important to allow OnlyHtml to control the studio's structure.
The final file should look like this
Then we need to configure OnlyHtml, open <your-site>/onlyhtml.json
After doing so we can fire up our new CMS dashboard by running
Visit localhost:3333
to view and edit your website's content. When ready, you can run sanity deploy
to deploy the dashboard publicly.
Sanity
Sanity.io is a headless CMS providing a unified content platform. It is very developer friendly and allows defining schemas and data types directly from code.
Sanity Studio
The Sanity Studio is an open-source CMS built with React.js. It offers rapid configuration and free form customization. A developer can spin one up locally and when ready deploy the studio to production so non-technical users can use it too.
Main features include
Document revision history with rollback to editing sessions.
Real-time collaboration. No locking or overwriting.
Works on your phone and other touch devices.
Batch image uploads. Paste pictures right from the clipboard.
Large ecosystem of plugins
While developing, sanity studio runs locally in its own process, auto-reloading on any code or configuration change. Running npm run serve
will start two servers, one for sanity Studio and the other for OnlyHtml. Edit the content in Sanity Studio and it will automaticlly appear in the website preview.
When your website is ready for publishing, run sanity deploy and follow the instructions from the sanity tool. This will deploy the Sanity Studio to a publicly available domain so anyone with credentials will be able to edit the content of your new website.
Last updated
Was this helpful?