{{/* The blog nav organizes posts grouped by year, which represents a customized version of the sidebar-tree in use elsewhere on the site. */}} {{/* We cache this partial for bigger sites and set the active class client side. */}} {{ $shouldDelayActive := ge (len .Site.Pages) 2000 }}
{{ define "blog-nav-section" }} {{ $shouldDelayActive := .delayActive }} {{ $sid := .section.RelPermalink | anchorize }} {{ $postsByYear := .section.Pages.GroupByDate "2006" }} {{ range $postsByYear }} {{ $year := .Key }} {{ $p := $.page }} {{ $active := eq ($p.Date.Format "2006") $year }} {{ $firstPost := .Pages | first 1 }} {{ end }} {{ end }} {{/* Reveal the remaining blog posts and hide the clicked link */}}