mirror of
https://github.com/welpo/tabi.git
synced 2026-02-15 23:57:19 +01:00
♻️ refactor: split macros.html in different files
Clearer macros format.
This commit is contained in:
parent
3d7a662ac8
commit
3aa22cb3ad
18 changed files with 233 additions and 256 deletions
41
templates/macros/cards_posts.html
Normal file
41
templates/macros/cards_posts.html
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
{% macro cards_posts(pages) %}
|
||||
<div class="cards">
|
||||
{%- for page in pages %}
|
||||
<div class="card">
|
||||
{% if page.extra.local_image %}
|
||||
<img class="card-image" alt={{ page.extra.local_image }} src="{{ get_url(path=page.extra.local_image) }}">
|
||||
{% elif page.extra.remote_image %}
|
||||
<img class="card-image" alt={{ page.extra.remote_image }} src="{{ page.extra.remote_image }}">
|
||||
{% else %}
|
||||
<div class="card-image-placeholder"></div>
|
||||
{% endif %}
|
||||
|
||||
<div class="card-info">
|
||||
<h1 class="card-title">
|
||||
{% if page.extra.link_to %}
|
||||
<a rel="noopener noreferrer" target="_blank" href={{ page.extra.link_to }}>{{page.title}}</a>
|
||||
{% else %}
|
||||
<a href={{ page.permalink }}>{{page.title}}</a>
|
||||
{% endif %}
|
||||
</h1>
|
||||
|
||||
<div class="meta">
|
||||
{%- if page.date %}
|
||||
{{ macros_format_date::format_date(date=page.date) }}
|
||||
{% endif -%}
|
||||
{% if page.draft %}
|
||||
<span class="draft-label">DRAFT</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="card-description">
|
||||
{% if page.description %}
|
||||
{{ page.description }}
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endfor -%}
|
||||
</div>
|
||||
{% endmacro cards_posts %}
|
||||
Loading…
Add table
Add a link
Reference in a new issue