Chapter 10

Page Templates and Frontmatter

You might have noticed that we finished Chapter 9 with a big loose end: The default “layout” default.html contains all the content from our main index page—this makes it effectively useless as a layout because it can’t show content for other pages. In this chapter, we’ll tie up this loose end by learning how to insert content dynamically, thereby making our layout a truly reusable template.

Site-wide elements like the header and footer will be the same on every page, while the content in between (the part shown in blue in Figure 9.41) will vary. We will use Jekyll page templates to do this and simplify our site’s structure, with a focus on developing unique content for each page. Along the way, we’ll ...

Get Learn Enough HTML, CSS and Layout to be Dangerous: An Introduction to Modern Website Creation and Templating Systems 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.