Skip to content

Commit

Permalink
fix blank 2023 section in home page
Browse files Browse the repository at this point in the history
  • Loading branch information
kw7oe committed Aug 8, 2023
1 parent 3758f0e commit 0475e2f
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions themes/my-theme/layouts/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@
{{ .Content }}
</div>
{{ range .Site.RegularPages.GroupByDate "2006" }}
<h3 class="mt-8 mb-2 font-bold">{{ .Key }}</h3>
<ul class="mb-12">
{{ range where .Pages "Type" "posts" }}
{{ partial "li.html" . }}
{{ $posts := where .Pages "Type" "posts" }}
{{ if ge (len $posts) 1 }}
<h3 class="mt-8 mb-2 font-bold">{{ .Key }}</h3>
<ul class="mb-12">
{{ range where .Pages "Type" "posts" }}
{{ partial "li.html" . }}
{{ end }}
</ul>
{{ end }}
</ul>
{{ end }}
{{ end }}

0 comments on commit 0475e2f

Please sign in to comment.