在我的化身博客已经有一个列出所有类别及其各自所有的帖子的网页,这里是代码:IF在杰基尔降价逻辑
{% for category in site.categories %}
<div class="col-md-12 content-panel articles">
<h2 id="{{ category | first }}-ref">{{ category | first }}</h2>
<ul style="list-style: none;">
{% for posts in category %}
{% for post in posts %}
<li>
<!-- problem of for cycle can't use images <img src="/{{ post.header-img | prepend: site.baseurl }}" class="img-responsive" alt="{{ post.title }}"> -->
<h3><a href="{{ post.url | prepend: site.baseurl }}">{{ post.title }}</a></h3>
<small class="hidden-xs">{{ post.date | date: "%B %-d, %Y" }}</small>
</li>
{% endfor %}
{% endfor %}
</ul>
</div>
{% endfor %}
我的问题是,我怎么能只显示例如categoryX
的帖子?
我意识到这可能是简单的东西,但无法找到任何地方如何,我试图改变for posts in category
到for posts in categoryX
但它没有工作
存储库网址可以帮助发现问题。 –