combination

This commit is contained in:
m
2026-03-25 01:32:03 +01:00
parent 67ec5753bf
commit a90f06d913
5 changed files with 8 additions and 18 deletions

2
app.py
View File

@@ -117,8 +117,6 @@ def post_detail(post_id):
return "Post not found", 404
comments = get_comments_for_post(post_id)
if post_id == 2:
return render_template('post_detail_test.html', post=post, comments=comments, blog_title = TITLE)
return render_template('post_detail.html', post=post, comments=comments, blog_title = TITLE)

Submodule content updated: 5dcd5bdcee...bf7589d017

View File

@@ -1,4 +1,3 @@
<div class="image-container">
<p>...</p>
<img src="{{ src }}" alt="{{ alt or 'image' }}" />
</div>

View File

@@ -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 %}

View File

@@ -1,5 +0,0 @@
{% for block in post.content %} {% if block.type == "image" %} {% include
"components/image.html" with src=url_for('content_image_files',
filename=block.src) %} {% elif block.type == "text" %}
<p>{{ block.value }}</p>
{% endif %} {% endfor %}