Merge pull request #116 from mancku/patch-1

Only creating the div if showing recent posts
This commit is contained in:
Guru Sabarish
2023-08-08 07:47:55 +05:30
committed by GitHub
@@ -1,5 +1,6 @@
{{ $currentNumOfrecentPosts := len (where .Site.RegularPages "Type" "posts") }}
{{ if and (gt $currentNumOfrecentPosts 0) (.Site.Params.footer.recentPosts.enable | default false) }}
<div class="container py-3" id="recent-posts">
{{ if .Site.Params.footer.recentPosts.enable | default false }}
{{ $recentPostsPath := .Site.Params.footer.recentPosts.path | default "blogs" }}
{{ $recentPostsCount := .Site.Params.footer.recentPosts.count | default 3 }}
{{ $recentPosts := where .Site.RegularPages "Section" $recentPostsPath | first $recentPostsCount }}
@@ -33,5 +34,5 @@
</div>
{{ end }}
</div>
{{ end }}
</div>
</div>
{{ end }}