How can I bind statements in Jekyll?

I use the boolean operator in Jekyll, but it does not work.

Page one, two and three all use the same layout (part of a multilingual solution, works well, but logical outlines are required to control the layout).

Here is the code:

{% if page.type == "post" %} {% include post.html %} {% elseif page.class == "contact" %} {% include contact.html %} {% else %} {{ content }} {% endif %} 

If I break it before installing else and if else , with any two from the tree, everything will work. But as soon as I use the third condition, it breaks. Am I limited to two conventions with Jekyll? I can potentially restructure to make the case applicable, but I would rather understand the underlying problem here. Thanks to everyone.

+61
ruby ruby-on-rails jekyll
Sep 14 '12 at 11:31
source share
1 answer

In Jekyll / Liquid else - if elsif is written, that is:

 {% if page.type == "post" %} {% include post.html %} {% elsif page.class == "contact" %} {% include contact.html %} {% else %} {{ content }} {% endif %} 
+109
Sep 14
source share



All Articles