Headless CMS with Contentful and Next.js

I've had the pleasure of working with the lovely Hotjar since around September 2020.

They initially contacted me to help complete a site migration away from the HubSpot platform and onto a bespoke Wagtail CMS installation.

For various reasons — issues with the migrated content structure, the need for rapid iteration, and internal developer preferences — using Wagtail wasn't working for Hotjar, so they wrapped up a successful rebrand with another site migration (they really are the essence of a fast-moving company).

This time, they are using Contentful as the content platform, and Next.js as the HTML rendering engine - or in industry speak, a headless CMS.

While I'm no stranger to writing JavaScript and React (see my post on adding footnotes to Wagtail), it's never been my primary focus - I really like Python, and I am especially keen on server side rendering of HTML (as opposed to client side rendering of HTML - I'm looking at you single page applications).

However, I was pleasantly surprised (when kept on as an ad-hoc web developer for Hotjar) that Next.js implements server side rendering (with a little bit of extra fancy stuff on the client side obvs), so visitors without JavaScript still get a usable website experience, rather than the dreaded white screens of SPAs.

I also like Contentful, having now seen and used it with real content. It's flexible, easy to use, and has some very elegant features (such as being able to select existing related content, or create a new instance of related content in situ).

And used together, this setup is fast - both at local development and production level.

However, what you gain in some areas (such as flexibility), you lose in others (such as bespoke content validation).

Maybe one day after writing this post, there will be a website setup that 100% meets the needs of all stakeholders - the visitors, the content editors, the internal developers.

I don't think we're there yet. Using new technology is great, but there is no magic bullet when building websites.

And I guess if there was, then I'd be less busy? 🤔