This content originally appeared on remy sharp's b:log and was authored by remy sharp's b:log
I found this really hard to determine in the 11ty documentation, so I've added it here for future reference.
If you want a default layout for all pages there's a few ways you can do this (which is why I found it hard to determine from the docs), but since I almost always have an .eleventy.js
configuration file, putting it there is (what I think) the cleanest solution:
// assumes that `base.njk` lives inside _includes/
eleventyConfig.addGlobalData('layout', 'base.njk');
Originally published on Remy Sharp's b:log
This content originally appeared on remy sharp's b:log and was authored by remy sharp's b:log
remy sharp's b:log | Sciencx (2023-11-06T10:16:27+00:00) Default layouts in 11ty [til/misc]. Retrieved from https://www.scien.cx/2023/11/06/default-layouts-in-11ty-til-misc/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.