summaryrefslogtreecommitdiff
path: root/templates/post_macros.html
diff options
context:
space:
mode:
authorRuben Beltran del Rio <jj@r.bdr.sh>2026-01-26 16:13:52 +0100
committerRuben Beltran del Rio <jj@r.bdr.sh>2026-01-27 16:20:37 +0100
commitc4be3181b6f9dc02f6b659506706445c11d9db45 (patch)
treea6e386e7f0e92a008bbdf80cfbb55bc75dcbe4d6 /templates/post_macros.html
parent5737068b4153ba6173206bdb05e504a41ee87d3b (diff)
Add a blog
Diffstat (limited to 'templates/post_macros.html')
-rw-r--r--templates/post_macros.html42
1 files changed, 42 insertions, 0 deletions
diff --git a/templates/post_macros.html b/templates/post_macros.html
new file mode 100644
index 0000000..c128bc5
--- /dev/null
+++ b/templates/post_macros.html
@@ -0,0 +1,42 @@
+{% macro meta(post) %}
+ <hr>
+ <aside class="meta">
+ <time datetime="{{ post.date }}">{{ post.date | date(format="%e %B %Y") }}</time>
+ {% if post.taxonomies.categories %}
+ <article class="category">
+ §
+ {% for category in post.taxonomies.categories %}
+ <a href="{{ get_taxonomy_url(kind="categories", name=category) }}">{{ category }}</a>
+ {% endfor %}
+ </article>
+ {% endif %}
+ {% if post.taxonomies.categories %}
+ <article class="tags">
+ ∈
+ <menu>
+ {% for tag in post.taxonomies.tags %}
+ <li><a href="{{ get_taxonomy_url(kind="tags", name=tag) }}">{{ tag }}</a></li>
+ {% endfor %}
+ </menu>
+ </article>
+ {% endif %}
+ </aside>
+{% endmacro meta %}
+
+{% macro summary(post) %}
+<article class="post-summary">
+ <h2>
+ <a href="{{ post.permalink }}">{{ post.title }}</a>
+ </h2>
+ {{ post_macros::meta(post=post) }}
+ {% if post.extra.visual_aid_src and post.extra.visual_aid_alt %}
+ <section class="hero-summary">
+ {% set resized_image = resize_image(path=post.extra.visual_aid_src, width=100, height=75) %}
+ <img src="{{ resized_image.url }}" alt="{{post.extra.visual_aid_alt}}" title="{{post.extra.visual_aid_alt}}">
+ <p>{{ post.summary | safe }}</p>
+ </section>
+ {% else %}
+ <p>{{ post.summary | safe }}</p>
+ {% endif %}
+</article>
+{% endmacro summary %}