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

Popular posts from this blog

ZeroMQ on Windows, with Qt Creator -

unity3d - Unity SceneManager.LoadScene quits application -

python - Error while using APScheduler: 'NoneType' object has no attribute 'now' -