ruby - Jekyll: check if post content empty -


i have series of posts in jekyll project of have title , have title , content. want different things post in each case. example:

{% post in site.categories.publications %}     {{ post.title }}     {% if post.content == "" or post.content == nil or post.content == blank %}         <p>nothing here.</p>     {% else %}         {{ post.content }}     {% endif %} {% endfor %} 

but if statement doesn't catch empty posts. based conditions on this page, none of 3 possibilities catch empty posts. ideas on how handle these posts?

make sure have nothing after front matter

--- --- no new line here !! 

no space, no new line

sometimes text editor add newline @ end of file. can rid of :

{% assign content = post.content | strip_newlines %} 

and test :

{% if content == ""  %} 

Comments

Popular posts from this blog

python - mat is not a numerical tuple : openCV error -

c# - MSAA finds controls UI Automation doesn't -

wordpress - .htaccess: RewriteRule: bad flag delimiters -