Reputation: 695
To assign class depending on page category I have following in my code:
{% assign category_class = 'category-' | append: {{ page.category }} %}
As expected I get <div class="category-sometext"
. But when building I also get warning about an unexpected character in this line.
What's wrong and how I can fix it?
Upvotes: 1
Views: 771
Reputation: 3793
You need to remove the {{ }}
around page.category
as you are already inside {% %}
. So:
{% assign category_class = 'category-' | append: page.category %}
Upvotes: 2