summaryrefslogtreecommitdiff
path: root/templates/macros.html
diff options
context:
space:
mode:
Diffstat (limited to 'templates/macros.html')
-rw-r--r--templates/macros.html24
1 files changed, 24 insertions, 0 deletions
diff --git a/templates/macros.html b/templates/macros.html
index 416c2b4..04b27bf 100644
--- a/templates/macros.html
+++ b/templates/macros.html
@@ -11,3 +11,27 @@
'廿九', '三十', '三十一'] %}
{% for c in year | as_str %}{{ lut1 | nth(n=c | int) }}{% endfor %}年{{ lut2 | nth(n=month-1)}}月{{ lut2 | nth(n=day-1) }}日
{% endmacro %}
+
+{% macro post_meta(post, chinese_date, expand) %}
+<div class="post-meta" {% if expand %}style="text-align: end"{% endif %}>
+ {% if expand %}<div>{% else %}<span>{% endif %}
+ {% for author in post.authors %}
+ {{ author }}
+ {% endfor %}
+ {% if expand %}</div>{% else %}</span>{% endif %}
+ {% if expand %}<div>{% else %}<span class="divider">{% endif %}
+ {% if chinese_date %}
+ {{ macros::format_chinese_date(year=post.year, month=post.month, day=post.day) }}
+ {% else %}
+ {{ post.date|date(format="%Y/%m/%d") }}
+ {% endif %}
+ {% if expand %}</div>{% else %}</span>{% endif %}
+ {% if expand %}<div>{% else %}<span class="divider">{% endif %}
+ {% if post.taxonomies.tags %}
+ {% for tag in post.taxonomies.tags %}
+ <span class="tag"><a href="{{ get_taxonomy_url(kind="tags", name=tag) | safe }}">#{{ tag }}</a></span>
+ {% endfor %}
+ {% endif %}
+ {% if expand %}</div>{% else %}</span>{% endif %}
+</div>
+{% endmacro %}