summaryrefslogtreecommitdiffstatshomepage
path: root/templates/macros.html
diff options
context:
space:
mode:
authorWolfgang Müller2021-06-16 16:06:06 +0200
committerWolfgang Müller2021-06-16 17:04:24 +0200
commit7fb5c0f88274637df2974fd06b8d9a6b42969d83 (patch)
tree17939ed86a6f9025ad6000acdde6f831c0ddd1c2 /templates/macros.html
parent0adb42668c2a95986d06857f8cd6e39885d65c33 (diff)
downloadzunzuncito-7fb5c0f88274637df2974fd06b8d9a6b42969d83.tar.gz
templates: Pass article class in render_post macro
Instead of using boolean arguments to control the article class (and which parts of the article are rendered), accept a class string that is used directly. For now, check for the right class before rendering a title - an upcoming commit will change this to be cleaner.
Diffstat (limited to '')
-rw-r--r--templates/macros.html10
1 files changed, 3 insertions, 7 deletions
diff --git a/templates/macros.html b/templates/macros.html
index 09b8a13..1ec8ab0 100644
--- a/templates/macros.html
+++ b/templates/macros.html
@@ -1,16 +1,12 @@
-{% macro render_post(post, mention=false, render_title=true) -%}
-{%- if mention %}
-<article class="mention">
-{%- else -%}
-<article>
-{%- endif %}
+{% macro render_post(post, class="feed") -%}
+<article class="{{ class }}">
<header>
<img class="avatar" alt="{{ config.extra.author }}" src="{{ config.extra.avatar }}" />
<div class="banner smaller">
<div class="info">
<a class="bold-hover" title="permalink to this post" href="{{ post.permalink }}">{% if mention %}№ {{ post.slug }} {% else %}§{% endif %}</a>
<time class="mute" datetime="{{ post.date }}" title="{{ post.date }}">{{ post.date | date(format="%F %R") }}</time>
- {%- if render_title and post.title %}<h2 class="mute">{{ post.title }}</h2>{% endif %}
+ {%- if class != "single" and post.title %}<h2 class="mute">{{ post.title }}</h2>{% endif %}
</div>
{%- if "tags" in post.taxonomies %}
<nav class="tags">