{% assign taxonomies = site.posts | group_by_exp: "post", "post.date | date: '%Y'" %}

<ul class="taxonomies">
  {%- for taxonomy in taxonomies -%}
    <li>
      {%- capture link -%}{{ page.permalink }}#{{ taxonomy.name }}{%- endcapture -%}
      <a class="taxonomy" href="{{ link | relative_url }}">
        <span>{{ taxonomy.name }}</span>
        <span>{{ taxonomy.size }}</span>
      </a> 
    </li>
  {%- endfor -%}
</ul>

{%- for taxonomy in taxonomies -%}
  <h2 id="{{ taxonomy.name }}">{{ taxonomy.name