diff options
author | Luke Hong <luke0724@hotmail.com> | 2022-07-25 21:42:52 +0300 |
---|---|---|
committer | Luke Hong <luke0724@hotmail.com> | 2022-07-26 22:17:45 +0300 |
commit | 5086aeb56d8bdbdf5e2c8cfba4762ed2b97481a9 (patch) | |
tree | fc206f0f90db2f2e2ff20f78e2fb3b2ec7d482c9 | |
parent | f61fcfff8565577a1777387e39281aa5caee99fa (diff) |
Posts appear consistently in the sidebar lists
Signed-off-by: Luke Hong <luke0724@hotmail.com>
-rw-r--r-- | layouts/partials/sidebar.html | 8 |
1 files changed, 4 insertions, 4 deletions
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> |