liquid - jekyll: check if there are no posts -
how can check if there no posts in _posts
folder?
so far, i've tried
{% if site.posts == null %} <p>no posts...yet.</p> {% endif %}
and
{% if site.posts == nil %} <p>no posts...yet.</p> {% endif %}
is possible in liquid?
grab size of posts array , compare 0:
{% assign psize = site.posts | size %} {% if psize == 0 %} <p>no posts...yet.</p> {% endif %}
Comments
Post a Comment