IP_
IP_

Reputation: 695

Liquid Warning: Unexpected character

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

Answers (1)

You need to remove the {{ }} around page.category as you are already inside {% %}. So:

{% assign category_class = 'category-' | append: page.category %}

Upvotes: 2

Related Questions