{% macro render_post(post, expanded=False) %} {% if expanded %} {% set ns = namespace(found=false, preview='') %} {% if post.content is iterable and post.content is not string %} {% for block in post.content %} {% if block.type == "text" and not ns.found %} {% set ns.preview = block.value | safe%} {% set ns.found = true %} {% endif %} {% endfor %} {% set preview = ns.preview %} {% else %} {% set preview = post.content | safe%} {% endif %}