How to handle template (layouts) inheritance in Jekyll?

jekyll, ruby-on-rails, yaml

Solution

What you mean is simply `{{ content }}`.

Yes, layouts can be piped. In your case, if a page uses template1 layout, it is the content for template1. Then, the result of template1 is the content for default.

Problem

I want to have a template "_layouts/template1.html" extend (Django-style) a template _layouts/default.html. I'm putting this as a YAML front matter in _layouts/template1.html ``` --- layout: default --- {{page.content}} ``` but apparently it doesn't work the way I'd like it to work (all the additional markup that is present in template1.html but IS NOT in default.html does not render). It looks like the file that uses template1 layout purely extends default.html. Is there any way to have layouts inheritance in Jekyll?

Original source