Browse Source

only show labels if posts exist

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

38
layouts/_default/list.html

@ -12,30 +12,30 @@
{{- end }}
</main>
<section>
<h2>Latest Posts:</h2>
{{ with $pages.Limit 4 }}
<section class="article-list">
{{ range . }}
{{ partial "article.html" . }}
{{ end }}
</section>
<section>
<h2>Latest Posts:</h2>
<section class="article-list">
{{ range . }}
{{ partial "article.html" . }}
{{ end }}
</section>
</section>
{{ end }}
</section>
<section>
<h2>All Posts:</h2>
{{ with $pages }}
{{ range .GroupByDate "2006" }}
<p>{{ .Key }}</p>
<ul>
{{ range .Pages -}}
<li><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></li>
{{ end -}}
</ul>
{{ end }}
<section>
<h2>All Posts:</h2>
{{ range .GroupByDate "2006" }}
<p>{{ .Key }}</p>
<ul>
{{ range .Pages -}}
<li><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></li>
{{ end -}}
</ul>
{{ end }}
</section>
{{ end }}
</section>
{{ end }}

Loading…
Cancel
Save