如何查看帖子里是否没有帖子_posts
folder?
到目前为止,我已经尝试过
{% if site.posts == null %}
<p>No posts...yet.</p>
{% endif %}
and
{% if site.posts == nil %}
<p>No posts...yet.</p>
{% endif %}
这在液体中可能吗?
获取 posts 数组的大小,然后将其与 0 进行比较:
{% assign psize = site.posts | size %}
{% if psize == 0 %}
<p>No posts...yet.</p>
{% endif %}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)