{% if '{posts}' in page.content_html %} {{ page.content_html.replace('{posts}', posts_html) | safe }} {% else %} {{ page.content_html | safe }} {% endif %}