Files
flask_blog/templates/components/post_renderer.html
2026-03-25 01:32:03 +01:00

11 lines
620 B
HTML

{% macro render_post(post) %}
<article class="blog-content">
{% if post.content is iterable and post.content is not string %} {# content is
[] → render blocks #} {% for block in post.content %} {% if block.type ==
"image" %} {% with src=url_for('content_image_files', filename=block.src) %}
{% include "components/image.html" %} {% endwith %} {% elif block.type ==
"text" %} {{ block.value | safe }} {% endif %} {% endfor %} {% else %} {#
content is """...""" → render HTML #} {{ post.content | safe }} {% endif %}
</article>
{% if post.template %} {% include post.template %} {% endif %} {% endmacro %}