webseite/templates/macros/blog.html

59 lines
2.3 KiB
HTML
Raw Normal View History

2018-02-25 00:06:19 +01:00
{% macro render_blog_post(post, from_index=false) %}
2019-02-12 17:45:44 +01:00
{% if from_index %}
<br/><hr/><br/>
{% endif %}
<div class="blog-post">
<header class="major">
{% if from_index %}
<h2><a href="{{ post|url }}">{{ post.title }}</a></h2>
{% else %}
<h2>{{ post.title }}</h2>
{% endif %}
<p class="meta">
{% if bag('translate', post.alt, 'blog_von')
%}{{ bag('translate', post.alt, 'blog_von') }}{% else
%}Geschrieben von{% endif %} {% if post.twitter_handle
%}<a href="https://chaos.social/@{{ post.twitter_handle
}}">{{ post.author or post.twitter_handle }}</a>{%
else %}{{ post.author }}{%
endif %}{% if post.pub_date
%} {% if bag('translate', post.alt, 'blog_am')
%}{{ bag('translate', post.alt, 'blog_am') }}{% else
%}am{% endif %} {{ post.pub_date.strftime('%d.%m.%Y') }}{%
endif %}</p>
</header>
<!-- Content -->
<section id="content">
{% if from_index %}
{{ post.body }}
{% else %}
{{ post.body }}
{{ post.beitrag }}
{% endif %}
</section>
{% if from_index %}
<a class="button fit" href="{{ post|url }}">{% if bag('translate', post.alt, 'blog_weiter')
%}{{ bag('translate', post.alt, 'blog_weiter') }}{% else
%}weiterlesen{% endif %}</a>
<br/>
{% else %}
{% if post.video_is_embeded %}{% for blk in post.video_embeded.blocks %}
{% if blk.video_url %}
{{ blk }} <br/>
<a class="button" href="https://www.youtube.com/watch?v={{ blk.video_url }}{% if post.alt %}&gl={{ post.alt }}&hl={{ post.alt }}{% endif %}" target="_blank" rel="noopener">{%
if bag('translate', post.alt, 'directytlink') %}{{ bag('translate', post.alt, 'directytlink') }}{%
else %}Direkt zum YouTube-Video{% endif %}</a>{% endif %}{% if blk.video
%} <a class="button" href="{{ blk.video|url }}" download>{%
if bag('translate', post.alt, 'directlink') %}{{ bag('translate', post.alt, 'directlink') }}{%
else %}Download Video{% endif %}</a>{% endif %}
<br/><br/>
2019-02-12 17:45:44 +01:00
{% endfor %}{%
endif %} {% if post.project %}
<div class="lightgallery" class="row alt">{%
for blk in post.project.blocks %}
{{ blk }}
{% endfor %}</div>{% endif %}{%
endif %}
2018-02-25 00:06:19 +01:00
</div>
{% endmacro %}