0
排除某个类别,我试图重建一个侧边栏部件,显示在杰基尔用我的类别。它现在正常工作。我想更改液体模板以排除在此窗口小部件中显示的特定类别链接。杰奇 - 液体模板 - 从微件
{% assign cat_list = site.categories %}
{% if cat_list.first[0] == null %}
{% for category in cat_list %}
<li><a href="{{ site.baseurl }}/categories#{{ category }}">{{ category }} <span class="cat-count">{{ cat_list[category].size }}</span></a></li>
{% endfor %}
{% else %}
{% for category in cat_list %}
<li><a href="{{ site.baseurl }}/categories#{{ category[0] }}">{{ category[0] }} <span class="cat-count">{{ category[1].size }}</span></a></li>
{% endfor %}
{% endif %}
{% assign cat_list = nil %}
我想我要的是像
{% for category in cat_list **UNLESS category = 'CATEGORY'** %}
但没有奏效。我有点卡住了,这可能吗?
谢谢。
谢谢你,我是在一般的液体/编程方式太新,完全理解我将如何实现这在我目前的代码中。但是我现在会采取一个措施,并在我确定有效的时候回来。 –