jeudi 4 juin 2015

Jekyll: Using Front Matter in Includes

Is it possible to use front matter in an include. I've got an include called image.html that looks like this.

image.html

{% if layout == 'page' %}
  <img src="{{ site.url }}/public/img/{{ include.url }}" class="page">
{% else %}
  <img src="{{ site.url }}/public/img/{{ include.url }}">
{% endif %}

And an about.md file that looks like this:

about.md

---
layout: page
---

{% include image.html url="img.jpg" %}

But for some reason, it isn't recognising the if layout statement. Any idea how to get this to work?

Any help is appreciated. Thanks in advance!

Aucun commentaire:

Enregistrer un commentaire