← hugo-clarity

Posts appear consistently in the sidebar lists

5086aeb56d8bdbdf5e2c8cfba4762ed2b97481a9 · Luke Hong · Jul 26, 2022 02:42

Signed-off-by: Luke Hong <luke0724@hotmail.com>

+4 −4 · 1 file changed

  • layouts/partials/sidebar.html +4 −4
diff --git a/layouts/partials/sidebar.html b/layouts/partials/sidebar.html
index 5d8970c..17b18b2 100644
--- a/layouts/partials/sidebar.html
+++ b/layouts/partials/sidebar.html
@@ -56,10 +56,10 @@
       </ul>
     {{ end }}
 
-    {{- $posts := where (where .Site.RegularPages "Permalink" "!=" .Permalink) "Type" "in" $s.mainSections }}
+    {{- $posts := where .Site.RegularPages "Type" "in" $s.mainSections }}
     {{- $featured := default 8 $s.numberOfFeaturedPosts }}
-    {{- $featured_posts := first $featured (where $posts "Params.featured" true)}}
-    {{- with $featured_posts }}
+    {{- $featuredPosts := first $featured (where $posts "Params.featured" true)}}
+    {{- with $featuredPosts }}
     <h2 class="mt-4">{{ T "featured_posts" }}</h2>
     <ul>
       {{- range . }}
@@ -72,7 +72,7 @@
     <h2 class="mt-4">{{ T "recent_posts" }}</h2>
     <ul class="flex-column">
       {{- $recent := default 8 $s.numberOfRecentPosts }}
-      {{- range first $recent $posts | symdiff $featured_posts }}
+      {{- range first $recent $posts | symdiff $featuredPosts }}
       <li>
         <a href="{{ .Permalink }}" class="nav-link" title="{{ .Title }}">{{ .Title | markdownify }}</a>
       </li>