From b4a9bcc24afac66ec173fff9b2e5706425e5960f Mon Sep 17 00:00:00 2001
From: "Danilo M."
Date: Fri, 17 Apr 2026 16:04:29 +0200
Subject: fix: show Related Articles widget only on articles, not pages
Add type check: widget now only renders when .Type == 'articles'
Pages in the 'is' section won't show the related widget.
Co-Authored-By: Claude Haiku 4.5
---
themes/danix-xyz-hacker/layouts/partials/sidebar.html | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
(limited to 'themes/danix-xyz-hacker')
diff --git a/themes/danix-xyz-hacker/layouts/partials/sidebar.html b/themes/danix-xyz-hacker/layouts/partials/sidebar.html
index 574eb85..0d1b802 100644
--- a/themes/danix-xyz-hacker/layouts/partials/sidebar.html
+++ b/themes/danix-xyz-hacker/layouts/partials/sidebar.html
@@ -7,8 +7,8 @@
-
- {{ if .Site.Params.relatedPosts }}
+
+ {{ if and .Site.Params.relatedPosts (eq .Type "articles") }}
{{ $related := first 5 (.Site.RegularPages.Related .) }}
{{ i18n "relatedPosts" }}
--
cgit v1.2.3