Repo template for Sanity + Eleventy projects at Self Aware
- Eleventy front-end lives in the
webdirectory - Templates are authored in the
web/src/templatesdirectory using any template language supported by eleventy (Nunjucks by default) - Eleventy global data files live in
web/src/data. - Styles are authored using Sass and live in
web/src/styles. Our utility-first styling library, wool is included by default and can be configured viaweb/src/styles/_config.scss - JavaScript lives in
web/src/scripts - Place font and favicon files in their respective folders in
web/src/assets. - Netlify serverless functions are authored in
web/src/functions - Place any eleventy related utilities in
web/src/util - Sanity Studio lives in the
studiodirectory
# Ensure correct Node and NPM versions are installed using NVM
nvm install
# Install Yarn
npm i -g yarn
# Install project dependencies using yarn
yarnTo set up with Sanity, you will need to set your Sanity projectId and dataset in two places:
# Start Netlify dev server
yarn dev
# Start Sanity dev server
yarn start:studio# Build front-end for production
yarn build# Deploy front-end using Netlify CLI
yarn add netlify-cli -g
netlify init
netlify deploy
# Deploy Sanity Studio
yarn deploy:studioThe following sites are powered by sane-eleventy:
- Off Season
- MIT Digital Humanities
- More coming soon!
Thanks to sane-shopify for the name inspiration 🙂
MIT