Layouts
Any source file can be rendered as content inside of a template.
Make a new subfolder in the skip-example
directory called templates
:
>>> mkdir templates
Next, create a template inside that folder
<!-- templates/my-template.j2 -->
<header> Here is my header! </header>
{{ content }}
<footer> Here is my footer! </footer>
Now, change index.md
from the Getting Started introduction to the following:
---
layout: my-template.j2
---
# Hello World!
Your index.html
in the site folder will now be rendered with the header and footer from the layout.
Next up, learn about looping over your site pages with collections