Skip empty titles in homepage Recent Posts cards

This commit is contained in:
svemagie
2026-03-08 07:56:52 +01:00
parent f61f7697ef
commit af9abf2368
2 changed files with 8 additions and 8 deletions
@@ -84,9 +84,9 @@
{{ post.date | dateDisplay }}
</time>
</div>
{% if post.data.title %}
{% if post.data.title and (post.data.title | trim) %}
<h3 class="p-name font-semibold text-surface-900 dark:text-surface-100 mt-1">
<a class="hover:text-accent-600 dark:hover:text-accent-400" href="{{ post.url }}">{{ post.data.title }}</a>
<a class="hover:text-accent-600 dark:hover:text-accent-400" href="{{ post.url }}">{{ post.data.title | trim }}</a>
</h3>
{% endif %}
{{ bookmarkedUrl | unfurlCard | safe }}
@@ -194,11 +194,11 @@
</div>
</div>
{% elif post.data.title %}
{% elif post.data.title and (post.data.title | trim) %}
{# ── Article card ── #}
<h3 class="p-name font-semibold text-surface-900 dark:text-surface-100 mb-1">
<a href="{{ post.url }}" class="u-url hover:text-accent-600 dark:hover:text-accent-400">
{{ post.data.title }}
{{ post.data.title | trim }}
</a>
</h3>
{% if showSummary and post.templateContent %}
@@ -84,9 +84,9 @@
{{ post.date | dateDisplay }}
</time>
</div>
{% if post.data.title %}
{% if post.data.title and (post.data.title | trim) %}
<h3 class="p-name font-semibold text-surface-900 dark:text-surface-100 mt-1">
<a class="hover:text-accent-600 dark:hover:text-accent-400" href="{{ post.url }}">{{ post.data.title }}</a>
<a class="hover:text-accent-600 dark:hover:text-accent-400" href="{{ post.url }}">{{ post.data.title | trim }}</a>
</h3>
{% endif %}
{{ bookmarkedUrl | unfurlCard | safe }}
@@ -194,11 +194,11 @@
</div>
</div>
{% elif post.data.title %}
{% elif post.data.title and (post.data.title | trim) %}
{# ── Article card ── #}
<h3 class="p-name font-semibold text-surface-900 dark:text-surface-100 mb-1">
<a href="{{ post.url }}" class="u-url hover:text-accent-600 dark:hover:text-accent-400">
{{ post.data.title }}
{{ post.data.title | trim }}
</a>
</h3>
{% if showSummary and post.templateContent %}