use dynamic path in recent posts section

This commit is contained in:
Guru Sabarish
2023-08-08 02:23:25 +00:00
parent d415ceb515
commit ba95980934
@@ -1,7 +1,7 @@
{{ $currentNumOfrecentPosts := len (where .Site.RegularPages "Type" "posts") }}
{{ $recentPostsPath := .Site.Params.footer.recentPosts.path | default "blogs" }}
{{ $currentNumOfrecentPosts := len (where .Site.RegularPages "Type" $recentPostsPath) }}
{{ if and (gt $currentNumOfrecentPosts 0) (.Site.Params.footer.recentPosts.enable | default false) }}
<div class="container py-3" id="recent-posts">
{{ $recentPostsPath := .Site.Params.footer.recentPosts.path | default "blogs" }}
{{ $recentPostsCount := .Site.Params.footer.recentPosts.count | default 3 }}
{{ $recentPosts := where .Site.RegularPages "Section" $recentPostsPath | first $recentPostsCount }}
<div class="h3 text-center text-secondary py-3">