Unlock seamless workflows and faster delivery with our latest releases - Join the deep dive

Connecting Sanity to 11ty: tips on serializers, portable text, and fetching data.

7 replies
Last updated: Sep 16, 2021
Does anyone know of a reference or tutorial for connecting Sanity’s to an 11ty’s frontend? The Starters are fine, but I’d like to create it from scratch, and see how everything is connects.
Thanks.
Sep 15, 2021, 10:59 PM
Hey there! Unfortunately, I don't think anyone has published a guide for connecting to 11ty from scratch. The closest would be this guide , which sort of dissects how the blog starter works.
Sep 15, 2021, 11:12 PM
Thank you, but this article but omits how the code in the
utils
and
_data
foldres came to be. I’m missing a key ideas around serializers, portable text, fetching data, etc.
I got everything working, but do not quite understand how it works together.
Sep 15, 2021, 11:27 PM
Thank you, but this article but omits how the code in the
utils
and
_data
came to be. I’m missing a key ideas around serializers, portable text, fetching data, etc.
I got everything working, but do not quite understand how it works together.
Sep 15, 2021, 11:27 PM
When I figure it out, I’ll write my own article. 🙂
Sep 15, 2021, 11:27 PM
Those are definitely things I struggled to understand when I first got here, as well, and aren't specific to 11ty.
When it comes to fetching data and using the JS client in general,
this page of the docs will help you get a better understanding of it. There's a lot going on there, though, so for now it's probably better to focus on: installation , configuring your client , and performing queries . Speaking of performing queries, you can learn how to use GROQ fairly quickly with this guide .
Portable Text and serializers are some of the hardest things to understand when you start off.
This is a good introduction to setting up your first custom serializers.
Sep 15, 2021, 11:44 PM
Those are definitely things I struggled to understand when I first got here, as well, and aren't specific to 11ty.
When it comes to fetching data and using the JS client in general,
this page of the docs will help you get a better understanding of it. There's a lot going on there, though, so for now it's probably better to focus on: installation , configuring your client , and performing queries . Speaking of performing queries, you can learn how to use GROQ fairly quickly with this guide .
Portable Text and serializers are some of the hardest things to understand when you start off.
This is a good introduction to setting up your first custom serializers.
Sep 15, 2021, 11:44 PM
Thank you for the thoughtful response. I will look into your suggestions.
Sep 16, 2021, 1:36 AM

Sanity– build remarkable experiences at scale

Sanity is a modern headless CMS that treats content as data to power your digital business. Free to get started, and pay-as-you-go on all plans.

Was this answer helpful?