Every post has a title. For unknown reason the template didn't show it. Signed-off-by: Roman Tsisyk <roman@tsisyk.com>
28 lines
996 B
HTML
28 lines
996 B
HTML
{% extends 'base.html' %}
|
|
|
|
{% block content %}
|
|
|
|
<h1>{{ resource.title }}</h1>
|
|
<p>{{ resource.date | date(format='%B %e, %Y') }}</p>
|
|
|
|
<div class="news_content"{% if resource.translations | length <= 1 %} dir="auto"{% endif %}>
|
|
{{ resource.content | safe }}
|
|
</div>
|
|
|
|
{% for media in resource.assets | sort %}
|
|
{% if media is ending_with(".mp4") %}
|
|
<video class="news_video" controls autoplay muted>
|
|
<source src="{{ resource_path | safe }}{{ media | split(pat='/') | last }}" type="video/mp4">
|
|
</video>
|
|
{% elif media is ending_with(".mp3") %}
|
|
{% else %} {# Match remaining file types as images #}
|
|
{% set meta = get_image_metadata(path=media) %}
|
|
<img class="news_image{% if meta.width > meta.height %}_landscape{% endif %}" src="{{ resource_path | safe }}{{ media | split(pat='/') | last }}" />
|
|
{% endif %}
|
|
{% endfor %}
|
|
|
|
<div class="back_to_news">
|
|
<a href="{{ get_url(path="@/news/_index.md", lang=lang) }}">{{ trans(key='back', lang=lang) }}</a>
|
|
</div>
|
|
|
|
{% endblock content %}
|