ungleich-staticcms/templates/macros/blog.html
2019-09-25 00:39:20 +09:00

24 lines
601 B
HTML

{% macro render_blog_post(post, from_index=false) %}
<div class="blog-post">
{% if from_index %}
<h2><a href="{{ post|url }}">{{ post.title }}</a></h2>
{% else %}
<h2>{{ post.title }}</h2>
{% endif %}
<p class="meta">
written by
{% if post.twitter_handle %}
<a href="https://twitter.com/{{ post.twitter_handle
}}">{{ post.author or post.twitter_handle }}</a>
{% else %}
{{ post.author }}
{% endif %}
on {{ post.pub_date }}
</p>
{% if from_index %}
{{ post.abstract }}
{% else %}
{{ post.body }}
{% endif %}
</div>
{% endmacro %}