Warning
This is not a tutorial to create an 11ty website, this’s a note! You can find some very new and useful techniques on this note alongside the official documentation.
Installation
- First, install nodejs.
- Using this starter template or Google’s high performance statrer theme (recommended). You should follow the installation steps given in the theme you choose
Setting & Deploy with Netlify
Sometimes, 11ty takes to much time to build (especially on the task of optimizing images). You shouldn’t use branch main
to build your site because every time you make a push to main
branch, Netlify will rebuild & deploy it. You should create a new branch base on main
branch. It so-called netlify
- Idea 1 - manually build but should not use many times On Netlify, go to Site Settings → Build & Deploy
- Build settings:
- Build command:
npm run build
(depends on your site) - Published directory:
_site
(depends on your site) - Builds: Active builds
- Build command:
- Deploys contexts:
- Production branch: netlify (the same as the your created branch)
- Deploy preview: Don’t deploy pull request
- Brand deploys: Deploys only the production branch
- Build settings:
- Idea 2 - Build locally and push
_site
only Remember that you have only 300 free minutes to build with Free Plan
Templating
SCSS to CSS
- If you use node-sass
- If you use rollup
Using postcss
Nunjucks inside css
Bootstrap + 11ty
👉 How to Isolate Bootstrap CSS to Avoid Conflicts (using LESS)