
Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag storeGreat to hear you're getting started with Sanity and Eleventy! There's actually a really helpful official guide from Sanity specifically for this combination.
Sanity has an official guide for getting started with the 11ty (Eleventy) Blog Starter. This guide walks you through:
_data directoryThe key to pulling content from Sanity into Eleventy is using 11ty's global data pattern. In the starter template, you'll find JavaScript files in the _data directory that fetch content from Sanity's API using GROQ queries.
Here's the basic approach:
/web/_data/ (like posts.js)For example, if you have posts.js in your _data folder, you can access that data in your Nunjucks templates as {{ posts }}.
The guide includes practical examples of:
There's also a follow-up guide on adding promotional images to extend your site further.
The combination of Eleventy and Sanity gives you a lot of flexibility - Eleventy handles your static site generation with minimal dependencies, while Sanity provides structured content with collaborative features and a global CDN for assets. Good luck with your first site!
Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.
Content operations
Content backend


The only platform powering content operations
By Industry


Tecovas strengthens their customer connections
Build and Share

Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag store