diff options
| author | Danilo M. <danix@danix.xyz> | 2026-04-17 16:04:29 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-04-17 16:04:29 +0200 |
| commit | b4a9bcc24afac66ec173fff9b2e5706425e5960f (patch) | |
| tree | dabdc23a7b3a255c1ffb573c0c17f90a488ca119 /themes/danix-xyz-hacker | |
| parent | 0280cbf618db38255e878fc4b1bd474223782696 (diff) | |
| download | danixxyz-b4a9bcc24afac66ec173fff9b2e5706425e5960f.tar.gz danixxyz-b4a9bcc24afac66ec173fff9b2e5706425e5960f.zip | |
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 <noreply@anthropic.com>
Diffstat (limited to 'themes/danix-xyz-hacker')
| -rw-r--r-- | themes/danix-xyz-hacker/layouts/partials/sidebar.html | 4 |
1 files changed, 2 insertions, 2 deletions
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 @@ </p> </div> - <!-- Related posts widget (optional) --> - {{ if .Site.Params.relatedPosts }} + <!-- Related posts widget (articles only) --> + {{ if and .Site.Params.relatedPosts (eq .Type "articles") }} {{ $related := first 5 (.Site.RegularPages.Related .) }} <div class="p-4 border border-border/30 rounded mb-6"> <h3 class="text-lg font-semibold text-accent mb-3">{{ i18n "relatedPosts" }}</h3> |
