I am trying to rebuild a blog in Jekyll and I have stubled upon a simple task.
Provided I have the following set of templates:
default.html:
You can't do this with a capture, but you can using an include. Every level of the page hierarchy can override the head
key to point to a different include file as required. This example wraps the include with a condition so if no head
key is specified the page will still generate.
{% if page.head %}
{% include {{ page.head }} %}
{% endif %}
{{ content }}
---
layout: default
head: header1.html
---
{{ content }}
(Frontpage header content)