chaoswest.tv/templates/macros/blog.html

28 lines
1003 B
HTML
Raw Permalink Normal View History

2022-01-20 23:51:09 +01:00
{%- macro render_blog_post(post, from_index=false) %}
2022-05-01 14:51:42 +02:00
<article>
2024-01-21 23:22:19 +01:00
{% if from_index %}
{% if post.logo is defined %}
<a href="{{ post|url(absolute=True) }}">
<img class="postlogo" alt="{{ post.logodesc }}" src="{{ post|url(absolute=True)}}{{ post.logo | url(absolute=False) }}" />
</a>
2024-01-21 23:22:19 +01:00
{% endif %}
<h2 class="headline"><a href="{{ post|url }}">{{ post.title }}</a>
<div class="subline">{{ post.event_start_date.strftime('%Y-%m-%d') }}/{{ post.event_end_date.strftime('%Y-%m-%d') }}</div>
</h2>
2024-01-21 23:22:19 +01:00
{% else %}
{% if post.logo is defined %}
<img class="postlogo" alt="{{ post.logodesc }}" src="{{ post.logo | url }}" />
2024-01-21 23:22:19 +01:00
{% endif %}
<h2 class="headline">{{ post.title }}
<div class="subline">{{ post.event_start_date.strftime('%Y-%m-%d') }}/{{ post.event_end_date.strftime('%Y-%m-%d') }}</div>
</h2>
2024-01-21 23:22:19 +01:00
{% endif %}
2022-01-20 23:51:09 +01:00
{% if from_index -%}
{{ post.preview }}
{% else -%}
{{ post.body }}
{% endif -%}
2022-05-01 14:51:42 +02:00
</article>
2022-01-20 23:51:09 +01:00
{% endmacro -%}