Minimal blog with Eleventy and Sanity.
This is a monorepo with a pre-configured Sanity Studio (/studio
) and a very basic setup of Eleventy (/web
).
npm install
in the project root folder on localnpm run sanity-init
to reconfigure the studio with a new or existing projectnpm run dev
to start the Studio and 11ty in watch mode
_site
npm run build
to build to production locallyYou can host both the studio and the 11ty blog on Netlify as two apps. Log in to your Netlify account and add them as two separate apps with the following settings:
<your repository>
studio
npm run build && cp ./netlify.toml dist
studio/dist
You have to add CORS-settings for the studio deployed on Netlify.
<your repository>
web
npm run build-web
web/_site
now
The now.json
has configuration for deploying both the frontend and the studio on one now deployment. The web frontend can be browsed from the root of your now domain. The Studio can be accessed on https://<your-domain>.now.sh/studio
.
Add a "basePath": "/studio"
to sanity.json
:
"project": {
"name": "sanity-tutorial-blog",
"basePath": "/studio"
},
You have to add CORS-settings for the studio deployed on now
.
Go to your projects API-settings on manage.sanity.io => Settings => API => CORS origins => Click "Add" => Add domain for the now deployment + Allow credentials.
or
> cd studio
> sanity cors add https://<your-domain>.now.sh`