leilukin-tumbleblog/themes/virgula/content/post.twig

39 lines
1.4 KiB
Twig
Raw Normal View History

2024-06-20 14:10:42 +00:00
<article class="post {{ post.feather }}{{ post.pinned ? ' pinned' : '' }}" id="post_{{ post.id }}">
<header>
<span class="permalink">
<a href="{{ post.url() }}" rel="bookmark" title="{{ 'Permanent link to &#8220;%s&#8221;' | translate | format(post.title | striptags | normalize | fix(true)) }}">&dagger;</a>
</span>
<span class="time">
{% if post.status == "draft" %}
{{ "Drafted on %s." | translate | format(post.created_at | time) }}
{% elseif post.status == "scheduled" %}
{{ "Scheduled for %s." | translate | format(post.created_at | time) }}
{% elseif post.pinned %}
{{ "Pinned on %s." | translate | format(post.created_at | time) }}
{% else %}
{{ "Posted on %s." | translate | format(post.created_at | time) }}
{% endif %}
</span>
{% if module_enabled("categorize") and post.category is defined %}
<span class="category">
{% set category_name = post.category.name | oneof("[Untitled]" | translate) %}
2024-09-05 17:51:48 +00:00
{% set category_link = '<a href="' ~ post.category.url() ~ '" rel="tag">' ~ category_name ~ '</a>' %}
2024-06-20 14:10:42 +00:00
{{ "Filed in %s." | translate | format(category_link) }}
</span>
{% endif %}
{% if (module_enabled("tags") and post.tags_link is not empty) %}
<span class="tags">
{{ "Tagged with %s." | translate | format(post.tags_link | join(", ")) }}
</span>
{% endif %}
</header>
{% block content %}{% endblock %}
<footer>
{% if post.editable() or post.deletable() %}
<div class="doaction admin">
{{ post.edit_link() }} {{ post.delete_link() }}
</div>
{% endif %}
</footer>
</article>