jeudi 31 décembre 2015

Jekyll categories causing problems with "if / then" statements

I have a jekyll post with YAML Front Matter like so:

---
layout: post
title:  "Insulation"
categories: build-manual
variable: build-manual // this is just for troubleshooting purposes
---

You would think on the post's page I could write a simple liquid if / then statement using the current post's category. Something like this:

{% if page.categories == 'build-manual' %}
Hey I am in build-manual category
{% else %}
No I am not in build-manual category
{% endif %}

For some reason, this does not work. I receive the output: "No I am not in build-manual category"

To make it more confusing, if I change "page.categories" to "page.variable" it works. I receive the output: "Hey I am in build-manual category"

Any ideas on why it's not recognizing the categories?

Aucun commentaire:

Enregistrer un commentaire