How it works...

This recipe is pretty straightforward; we separate our index.html file in a meaningful way, so as to be able to reuse it with any other file. That is exactly what we do when we add the about.html page. Besides using the _layout file of default-layout.html, we also address the use of _includes, namely the nav.html and footer.html files. Although we could have added the includes to our default-layout.html, this setup is much better, as it caters for greater modularity and gives us options that we would not have otherwise. For example, we could add a different layout, and inside that layout, we could add a different nav and a different footer, which would be great for A/B testing.

Get Bootstrap 4 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.