Understanding the difference between a page, template, and layout
One of 11ty’s strengths is also a source of confusion. 11ty comes bundled with 10 templating languages. These languages (including Liquid, Nunjucks, and Handlebars) can be used to create individual pages, includes, and layouts, and can be chained together to create complex systems. While this is incredibly powerful, it can create confusion around terminology.
The 11ty documentation says that layouts “are special templates that can be used to wrap other content.” This doesn’t necessarily clear things up. For this book, we’ll use the following definitions to try to keep things clear:
- Page – an item meant to be rendered as a single URL on the final site, for example,
index.html
orabout.html
in this project - Layout – a file that is used by a page to wrap content in the entire structure for an HTML page
- Include – a file consisting of a small, reusable...