lundi 28 mars 2016

How to add class in jade using if statement of jinja

I am using jade instead of HTML and jinja template. I need to add a particular class after checking some variables value.

section.all-articles.large-7.columns

Here in the above line of code I need to add another class .mid

{% if articles|length < 10 %}
//add a class .mid
{% endif %}

And I want my resultant as

section.all-articles.large-7.columns.mid when its converted to html.

Aucun commentaire:

Enregistrer un commentaire