我是使用Jekyll和Jekyll-Bootstrap的新手。
我找到了按类别过滤的方法:
<ul class="posts">
{% for post in site.posts %}
{% if post.categories contains 'demography' %}
<li><span>{{ post.date | date_to_string }}</span> » <a href="{{ BASE_PATH }}{{ post.url }}">{{ post.title }}</a></li>
{% endif %}
{% endfor %}
</ul>当我尝试组合标签和类别时,它不起作用:
<ul class="posts">
{% for post in site.posts %}
{% if post.categories contains 'demography' and post.tags contains 'R' %} %}
<li><span>{{ post.date | date_to_string }}</span> » <a href="{{ BASE_PATH }}{{ post.url }}">{{ post.title }}</a></li>
{% endif %}
{% endfor %}
</ul>有什么想法吗?
提前感谢!
发布于 2012-08-18 04:35:21
您在第3行中有太多的%}。
除此之外,它应该工作得很好。
https://stackoverflow.com/questions/12008108
复制相似问题