33 lines
1.2 KiB
Twig
33 lines
1.2 KiB
Twig
|
{% extends "content" ~ DIR ~ "post.twig" %}
|
||
|
|
||
|
{% block content %}
|
||
|
{% if post.title is not empty %}
|
||
|
<header>
|
||
|
<h2>
|
||
|
<a href="{{ post.url() }}" rel="bookmark" title="{{ 'Permanent link to “%s”' | translate | format(post.title | striptags | normalize | fix(true)) }}">{{ post.title }}</a>
|
||
|
</h2>
|
||
|
<h3>
|
||
|
<a href="{{ url('author/' ~ post.author.id) }}">{{ "Written by %s" | translate | format(post.author.name) }}</a>
|
||
|
</h3>
|
||
|
</header>
|
||
|
{% endif %}
|
||
|
{% if post.caption is not empty %}
|
||
|
<section class="caption" aria-label="{{ 'Text Content' | translate }}">
|
||
|
{{ post.caption }}
|
||
|
</section>
|
||
|
{% endif %}
|
||
|
{% for file in post.files %}
|
||
|
{% if ["jpg", "jpeg", "png", "gif", "webp", "avif"] | contains(file.type) %}
|
||
|
<section class="photo" aria-label="{{ 'File Attachment' | translate }}">
|
||
|
{{ file.name | thumbnail(file.name, post.source, ["max_width=960", "max_height=960", "quality=80"], "(max-width: 959px) 95vw, 75vw") }}
|
||
|
</section>
|
||
|
{% else %}
|
||
|
<section class="attachment" aria-label="{{ 'File Attachment' | translate }}">
|
||
|
<h3>{{ "File attachment:" | translate }}</h3>
|
||
|
<a href="{{ file.name | download }}">{{ file.name | fix | truncate(40) }}</a>
|
||
|
({{ file.size | filesizeformat }})
|
||
|
</section>
|
||
|
{% endif %}
|
||
|
{% endfor %}
|
||
|
{% endblock %}
|