combination
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
<div class="image-container">
|
||||
<p>...</p>
|
||||
<img src="{{ src }}" alt="{{ alt or 'image' }}" />
|
||||
</div>
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
{% macro render_post(post) %}
|
||||
<article class="blog-content">{{ post.content | safe }}</article>
|
||||
{% if post.template %} {% include post.template %} {% endif %} {% endmacro %} {%
|
||||
macro render_test(post) %}
|
||||
<article class="blog-content">
|
||||
{% 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" %}
|
||||
<p>{{ block.value }}</p>
|
||||
{% endif %} {% endfor %}
|
||||
{% 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>
|
||||
{% endmacro %}
|
||||
{% if post.template %} {% include post.template %} {% endif %} {% endmacro %}
|
||||
|
||||
Reference in New Issue
Block a user