<!-- This page is the same as the Archives page -->
{{ define "main" }}
<!-- All of the site's posts grouped by year -->
  <h1>
    Archives
  </h1>
  <div>
     <!-- Group all the post pages from the same year -->
      {{ $pages := where site.RegularPages "Type" "in" site.Params.mainSections }}
      {{ range ($pages.GroupByDate "2006") }}
          <h3>{{ .Key }}</h3> <!-- Display the year -->

          <ul class="archives-list"> 
            
              {{ range (.Pages) }}
             
                  <li class="archives-list-item">
                    <span class="archives-list-item-date">{{ .PublishDate.Format "Jan 2" }}</span>
                    <span>
                      <a href="{{ .RelPermalink }}">{{ .Title }}</a>
                    </span>
                  </li>
              {{ end }}
          </ul>
      {{ end }}
  </div>

  <div class="page-footer"></div>

{{ end }}