fmartingr.com/templates/macros/blog.html
2020-01-12 20:26:01 +01:00

24 lines
806 B
HTML

{% macro render_blog_post(post, from_index=false, include_content=true) %}
{% set summary = post.body.html.split('<!-- readmore -->') %}
<article class="blog-post center">
<h1 class="title"><a href="{{ post|url }}">{{ post.title }}</a></h1>
<div class="info">
Published on {{ post.pub_date }}
</div>
{% if include_content %}
<div class="content">
{% if from_index and summary|length > 1 %}
{{ summary[0] }}
<p class="text-right"><a href="{{ post|url }}">Read more &raquo;</a></p>
{% else %}
{{ post.body }}
{% endif %}
</div>
{% if not from_index and post.edit_comment %}
<h3>Edits</h3>
{{ post.edit_comment }}
{% endif %}
{% endif %}
<hr class="light">
</article>
{% endmacro %}