title: Error: Liquid syntax error: Unknown tag -- variable scope?
body: <p>I'm trying to determine which css class to give a div based on the category of a post, but I keep getting a <code>Error: Liquid syntax error: Unknown tag</code> on the variable that I created.</p>
  
  <pre><code>  {% for post in site.posts %}
      &lt;!-- Figuring out which css class to give the cards --&gt;
      {% assign card_class = "" %}
      {% if page.category == 'code' %}
        {% assign card_class = "card-code" %}
      {% else %}
        {% assign card_class = "card-general" %}
      {% endif %}
      &lt;div class="col-1-2"&gt;
        &lt;div class="paper-card {% card_class %}"&gt;
          &lt;h3&gt;
            &lt;a class="post-link" href="{{ post.url | prepend: site.baseurl }}"&gt;{{ post.title }}&lt;/a&gt;
          &lt;/h3&gt;
          &lt;p class="post-excerpt"&gt;&lt;span class="post-meta"&gt;{{ post.date | date: "%b %-d, %Y" }}&lt;/span&gt;{{ post.excerpt | strip_html }}&lt;/p&gt;
        &lt;/div&gt;
      &lt;/div&gt;
    {% endfor %}
  </code></pre>
  
  <p>So <code>{% card_class %}</code> throws an error. Is it out of scope? Is there a way to get that value into the class attribute?</p>