Browse Source

only show labels if posts exist

simplify
Alexander Avery 2 months ago
parent
commit
86a069e5ef
  1. 8
      layouts/_default/list.html

8
layouts/_default/list.html

@ -12,20 +12,20 @@
{{- end }} {{- end }}
</main> </main>
{{ with $pages.Limit 4 }}
<section> <section>
<h2>Latest Posts:</h2> <h2>Latest Posts:</h2>
{{ with $pages.Limit 4 }}
<section class="article-list"> <section class="article-list">
{{ range . }} {{ range . }}
{{ partial "article.html" . }} {{ partial "article.html" . }}
{{ end }} {{ end }}
</section> </section>
{{ end }}
</section> </section>
{{ end }}
{{ with $pages }}
<section> <section>
<h2>All Posts:</h2> <h2>All Posts:</h2>
{{ with $pages }}
{{ range .GroupByDate "2006" }} {{ range .GroupByDate "2006" }}
<p>{{ .Key }}</p> <p>{{ .Key }}</p>
<ul> <ul>
@ -34,8 +34,8 @@
{{ end -}} {{ end -}}
</ul> </ul>
{{ end }} {{ end }}
{{ end }}
</section> </section>
{{ end }}
{{ end }} {{ end }}

Loading…
Cancel
Save