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

ios - MKAnnotationView layer is not of expected type: MKLayer -

ZeroMQ on Windows, with Qt Creator -

unity3d - Unity SceneManager.LoadScene quits application -