feat: add reusable macros

This commit is contained in:
Devin Haska 2024-02-19 11:52:18 -08:00
parent a8555c4e89
commit 28baa94b93
5 changed files with 20 additions and 21 deletions

View file

@ -0,0 +1,5 @@
{% macro format(dateString) %}
<time class="[ date ] [ flex items-center gap-0.5 my-1 ]" datetime="{{ date }}">
{% include "svgs/calendar.svg" %}{{ dateString | formatDate("MMMM Do YYYY") }}
</time>
{% endmacro %}

View file

@ -0,0 +1,7 @@
{% macro list(tags) %}
{% if tags | length > 0 %}
<ul class="[ flex list-none p-0 gap-0.5 mb-0 ]">
{% for tag in tags %}<li class="[ bg-surface radius-1 px-1 py-0.5 ]">{{ tag }}</li>{% endfor %}
</ul>
{% endif %}
{% endmacro %}