From 7c806b238dc94ff71ccc0c9bd1453ad79aa6e2a8 Mon Sep 17 00:00:00 2001 From: svemagie <869694+svemagie@users.noreply.github.com> Date: Sun, 8 Mar 2026 08:07:36 +0100 Subject: [PATCH] Remove Untitled fallback in homepage Recent Posts --- _includes/layouts/home.njk | 18 ++++++++++++------ theme/_includes/layouts/home.njk | 18 ++++++++++++------ 2 files changed, 24 insertions(+), 12 deletions(-) diff --git a/_includes/layouts/home.njk b/_includes/layouts/home.njk index 1a90b60..cdab261 100644 --- a/_includes/layouts/home.njk +++ b/_includes/layouts/home.njk @@ -81,12 +81,15 @@ withSidebar: true

Recent Posts

{% for post in collections.posts | head(10) %} -
-

- - {{ post.data.title or post.data.name or "Untitled" }} - -

+
+ {% set postTitle = ((post.data.title or post.data.name or "") | trim) %} + {% if postTitle %} +

+ + {{ postTitle }} + +

+ {% endif %} {% if post.data.summary %}

{{ post.data.summary }}

{% endif %} @@ -94,6 +97,9 @@ withSidebar: true + {% if not postTitle %} + Permalink + {% endif %} {% if post.data.postType %} {{ post.data.postType }} {% endif %} diff --git a/theme/_includes/layouts/home.njk b/theme/_includes/layouts/home.njk index 0f26556..32b0793 100644 --- a/theme/_includes/layouts/home.njk +++ b/theme/_includes/layouts/home.njk @@ -79,12 +79,15 @@ withSidebar: true

Recent Posts

{% for post in collections.posts | head(10) %} -
-

- - {{ post.data.title or post.data.name or "Untitled" }} - -

+
+ {% set postTitle = ((post.data.title or post.data.name or "") | trim) %} + {% if postTitle %} +

+ + {{ postTitle }} + +

+ {% endif %} {% if post.data.summary %}

{{ post.data.summary }}

{% endif %} @@ -92,6 +95,9 @@ withSidebar: true + {% if not postTitle %} + Permalink + {% endif %} {% if post.data.postType %} {{ post.data.postType }} {% endif %}