blog/templates/macros/card.html

70 lines
2.9 KiB
HTML
Raw Normal View History

2023-04-07 21:39:33 +02:00
{% macro create_card(link, img, title, subtitle, abstract, tags, date) %}
2023-03-31 21:59:07 +02:00
<div class="card has-equal-height">
2023-04-07 21:39:33 +02:00
<a href="{{ link | safe }}" style="height:100%">
<div class="card-content" style="height:100%">
2023-03-31 21:59:07 +02:00
<div class="title is-3 has-text-centered">{{ title }}</div>
2023-04-07 21:39:33 +02:00
<div class="title is-5 has-text-centered">{{ subtitle }}</div>
2023-03-31 21:59:07 +02:00
<div class="media">
2023-04-08 19:43:40 +02:00
<div class="content" style="width:100%;">
2023-05-06 20:30:36 +02:00
<hr class="mt-1"/>
2023-03-31 21:59:07 +02:00
{{ abstract | markdown | safe }}
</div>
</div>
</div>
</a>
2023-05-06 20:30:36 +02:00
<footer class="mt-5 card">
2023-03-31 21:59:07 +02:00
<div class="card-footer-item">
{% for tag in tags %}
2023-04-08 19:43:40 +02:00
<a class="button is-small is-info is-light is-rounded mx-1" href="{{ get_url(path="tags/") }}/{{ tag }}"> {{ tag }}</a>
2023-03-31 21:59:07 +02:00
{% endfor %}
</div>
<div class="card-footer-item">
2023-05-06 20:30:36 +02:00
{{ date | date(format="%d %B %Y", locale="fr_FR") }}
2023-03-31 21:59:07 +02:00
</div>
</footer>
</div>
{% endmacro %}
{% macro create_card_tag(link, title) %}
<div class="column is-one-third">
<div class="card">
<a class="card-content" href={{ link }}{{ title }}>
<div class="media">
<div class="title is-3 has-text-centered">{{ title }}</div>
</div>
</a>
</div>
</div>
{% endmacro %}
2023-05-06 20:30:36 +02:00
{% macro create_card_note(link, img, title, subtitle, abstract, tags, date) %}
<div class="card has-equal-height">
<a href="{{ link | safe }}" style="height:100%">
<div class="card-content" style="height:100%">
<div class="title is-5 has-text-centered">{{ title }}</div>
<div class="subtitle has-text-centered">{{ subtitle }}</div>
<div class="media">
<div class="content" style="width:100%;">
<hr class="mt-1"/>
{{ abstract | markdown | safe }}
</div>
</div>
</div>
</a>
<footer class="mt-1 card-footer">
<div class="card-footer-item">
{% for tag in tags %}
<a class="button is-small is-info is-light is-rounded mx-1" href="{{ get_url(path="tags/") }}/{{ tag }}"> {{ tag }}</a>
{% endfor %}
</div>
<div class="card-footer-item">
{{ date | date(format="%d %b", locale="fr_FR") }}
</div>
</footer>
</div>
{% endmacro %}