Emilio Noa
Blog with Sanity.io Headless CMS - Developer Log 1

Blog with Sanity.io Headless CMS - Developer Log 1

Headless CMS

A content management system allows developers and anyone to manage content in a website, usually with a snazzy user interface. The headless part comes in when it comes to the front-end interface the end-user will see. A regular CMS will couple the content to a display provided usually by the same provider, the most famous example of this is Wordpress. In contrast, a headless CMS provides the data stored as a backend with an API for developers to provide their own front-end interface.

Choosing a CMS

Sanity.io is far from the most popular CMS choice for today's developer. In terms of popularity, it has over 3000⭐ on Github, in contrast to Strapi's 44,000⭐.

Which begs the question, why did I choose Sanity? The main reason being ease of use and customizability. In contrast to Strapi and other solutions, Sanity has the upperhand when it comes to its learning curve, the biggest of the hurdles required to use it being picking up some GROQ (Graph-Relational Object Queries), speaking of which...

Queries

Getting your data out out of Sanity.io's CMS may seem intimidating at first, especially once you first meet the GROQ syntax. Fear not however, querying your content out of the back-end provided by Sanity is not as complicated as it may seem at first, you can find a cheat sheet of querying examples here.

The key here is learning by example, the Sanity team has provided a wide array of example use cases for querying through GROQ, and you're sure to find an query that matches your need there if you spend a bit of time looking.

Up next

In the next developer log, we will see how we use Next.js to display all of our content in a server side rendered application to help us with load times and SEO (Search Engine Optimization), both crucial to the perfomance of a good blog. Check out last week's post on my current project, Squishtrade!