Break section template into first and descendent sections

First section templates render the most recent $n yearly subsections as a list of
articles.

Descendent sections render just the content of those subsections.
This commit is contained in:
Eryn Wells 2024-10-23 11:16:16 -07:00
parent 50dc3c45c1
commit 59ff58e159
6 changed files with 81 additions and 26 deletions

View file

@ -0,0 +1,13 @@
{{- $years := .years -}}
{{- $includeCollapsedYearItem := .includeCollapsedYearItem -}}
<nav class="year-nav tag">
<span class="tag__name">{{ i18n "yearsTagTitle" }}</span>
<ul class="tag__value--list">
{{ range $years -}}
<li class="tag__value__list-item"><a href="#{{ .Date | time.Format "2006" }}">{{ .LinkTitle }}</a></li>
{{ end }}
{{ if $includeCollapsedYearItem -}}
<li class="tag__value__list-item"><a href="#older">{{ i18n "olderPagesSectionTitle" }}</a></li>
{{ end }}
</ul>
</nav>