9 Adding a content management system

 

This chapter covers

  • The pros and cons of the two types of headless CMSs
  • Choosing between the Contentful and Sanity API-based headless CMSs
  • Using WordPress as a headless CMS
  • Building a site using Gatsby’s WordPress integration
  • Using site builders to create Jamstack sites connected to a CMS

Jamstack is often associated with a file-based content management system that uses a combination of manually edited Markdown and YAML files. That’s because many static site generators default to this type of manual content management, even today. But the reality is that some form of headless content management system has become a de facto integration in most Jamstack sites.

Jamstack.org maintains a list of headless CMSs (https://jamstack.org/headless-cms) that you can search by type and license (i.e., whether they are open or closed source). Currently, it lists 87 options. Needless to say, that’s a lot of choices and more than we can cover in a chapter. Instead, we’ll look at the different types of headless CMS available and then explore some options to give you a sense of how their approaches differ and to help you make informed choices about what you are looking for.

9.1 Types of headless CMSs

As we discussed in chapter 4, there are two broad types of headless CMS:

9.1.1 Pros and cons of Git-based headless CMSs

9.1.2 Pros and cons of API-based headless CMSs

9.2 Exploring popular headless CMSs

9.2.1 Contentful

9.2.2 Sanity

9.2.3 Defining a content model using Sanity

9.3 Using WordPress

9.3.1 Installing WordPress locally with Local

9.3.2 Installing the Gatsby plug-ins for WordPress

9.3.3 Setting up Gatsby

9.3.4 Exploring Gatsby’s data layer

9.3.5 Consuming WordPress content in Gatsby