timeline post
This commit is contained in:
4
app.py
4
app.py
@@ -116,6 +116,10 @@ def post_detail(post_id):
|
|||||||
return "Post not found", 404
|
return "Post not found", 404
|
||||||
#get comments
|
#get comments
|
||||||
comments = get_comments_for_post(post_id)
|
comments = get_comments_for_post(post_id)
|
||||||
|
if post.id == 10:
|
||||||
|
|
||||||
|
post.template = "components/timeline_post.html"
|
||||||
|
|
||||||
|
|
||||||
# 2. Pass the post dictionary (with the raw HTML content) directly to the template
|
# 2. Pass the post dictionary (with the raw HTML content) directly to the template
|
||||||
return render_template('post_detail.html', post=post, comments=comments, blog_title = TITLE)
|
return render_template('post_detail.html', post=post, comments=comments, blog_title = TITLE)
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{% macro render_post(post) %}
|
{% macro render_post(post) %}
|
||||||
<article class="blog-content">
|
<article class="blog-content">
|
||||||
{% if post.template %} {% include post.template %} {% endif %} {{ post.content
|
{{ post.content | safe }}{% if post.template %} {% include post.template %} {%
|
||||||
| safe }}
|
endif %}
|
||||||
</article>
|
</article>
|
||||||
|
|
||||||
<hr class="post-divider post-divider-expanded" />
|
<hr class="post-divider post-divider-expanded" />
|
||||||
|
|||||||
1
templates/components/timeline_post.html
Normal file
1
templates/components/timeline_post.html
Normal file
@@ -0,0 +1 @@
|
|||||||
|
{% include "components/timeline.html" %}
|
||||||
Reference in New Issue
Block a user