fix
This commit is contained in:
@@ -1,12 +1,11 @@
|
|||||||
{% macro render_post(post) %}
|
{% macro render_post(post) %}
|
||||||
<article class="blog-content">
|
<article class="blog-content">
|
||||||
{% if post.content is iterable and post.content is not string %} {# content is
|
{% if post.content is iterable and post.content is not string %} {% for block
|
||||||
[] → render blocks #} {% for block in post.content %} {% if block.type ==
|
in post.content %} {% if block.type == "image" %} {% with
|
||||||
"image" %} {% with src=url_for('content_image_files', filename=block.src) %}
|
src=url_for('content_image_files', filename=block.src) %} {% include
|
||||||
{% include "components/image.html" %} {% endwith %} {% endif %} {% elif
|
"components/image.html" %} {% endwith %} {% elif block.type == "text" %} {{
|
||||||
block.type == "text" %} {{ block.value | safe }} {% endif %} {% elif
|
block.value | safe }} {% elif block.type == "code" %} {% with
|
||||||
block.type == "code" %} {% with value=block.src %} {% include
|
value=block.value %} {% include "components/code.html" %} {% endwith %} {%
|
||||||
"components/code.html" %} {% endwith %} {% endif %} {% endfor %} {% else %} {#
|
endif %} {% endfor %} {% else %} {{ post.content | safe }} {% endif %}
|
||||||
content is """...""" → render HTML #} {{ post.content | safe }} {% endif %}
|
|
||||||
</article>
|
</article>
|
||||||
{% if post.template %} {% include post.template %} {% endif %} {% endmacro %}
|
{% if post.template %} {% include post.template %} {% endif %} {% endmacro %}
|
||||||
|
|||||||
Reference in New Issue
Block a user