summaryrefslogtreecommitdiffstats
path: root/themes
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-04-18 17:05:55 +0200
committerDanilo M. <danix@danix.xyz>2026-04-18 17:05:55 +0200
commitc1407fa9fb558e42588aa194a53e78a087f045f0 (patch)
treed07132ae4a6091d6ec31e8ce45c673ee89bfc722 /themes
parentcafcb27e6f8a5139e9a9b5f869c656de9a05f157 (diff)
downloaddanixxyz-c1407fa9fb558e42588aa194a53e78a087f045f0.tar.gz
danixxyz-c1407fa9fb558e42588aa194a53e78a087f045f0.zip
fix: enable related articles widget on article pages
The related widget was not displaying because the condition used .Type (the article's frontmatter type field like "life", "tech") instead of .Section (the content section like "articles"). Changed condition from eq .Type "articles" to eq .Section "articles". Also added Hugo's [related] configuration block to enable content matching by categories (weight 100) and tags (weight 80) with an 80% threshold for finding related posts. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Diffstat (limited to 'themes')
-rw-r--r--themes/danix-xyz-hacker/layouts/partials/sidebar.html2
1 files changed, 1 insertions, 1 deletions
diff --git a/themes/danix-xyz-hacker/layouts/partials/sidebar.html b/themes/danix-xyz-hacker/layouts/partials/sidebar.html
index f80c2cf..dc263e6 100644
--- a/themes/danix-xyz-hacker/layouts/partials/sidebar.html
+++ b/themes/danix-xyz-hacker/layouts/partials/sidebar.html
@@ -13,7 +13,7 @@
{{ partial "social-share.html" (dict "page" . "mode" "sidebar") }}
<!-- Related posts widget (articles only) -->
- {{ if and .Site.Params.relatedPosts (eq .Type "articles") }}
+ {{ if and .Site.Params.relatedPosts (eq .Section "articles") }}
{{ $related := first 5 (.Site.RegularPages.Related .) }}
<hr class="sidebar-hr">
<div class="sidebar-widget">