Group series by year

Hi!

I am using taxonomies for making series, and have a nice list made. I would like to group the list into years. I could use the “categories” taxonomy for assigning a year to each page, but how should I group the output of my series list into these years?

Given that I will have in each page:

series = ["My trip to Germany"]
category = ["2015"]

And I would like the output result to be:

Year 2015:
– My Trip to Germany
— Part one

Year 2016:
– My trip to France
— Part one

This is what I have right now, without the years:

{{ range $taxonomyname, $taxonomy := .Site.Taxonomies }}
      {{ range $key, $value := $taxonomy }}
      <b> {{ $key }} </b>
            <ul>
            {{ range $value.Pages.ByDate }}
                <li hugo-nav="{{ .RelPermalink}}"><a href="{{ .Permalink}}"> {{ .LinkTitle }} </a> </li>
            {{ end }}
            </ul>
      {{ end }}
{{ end }}

My technique is probably awful but it works.

In the md
categories-2016 = ""
categories-2015 = "true"
categories-2014 = “”

In the html

{{ range   ( where  .Site.Pages ".Params.categories-2015"  "true") }}
<a href="{{ .URL }}">{{ .Title}}</a>
{{ end }}