Tips and tricks for building a theme in Hugo

So I am learning how to build a theme in hugo and wanted to document the things I found that were not obvious to me.

  1. To add a list of categories with counts of articles in each category use this snippet I found in the hugo-icarus theme.
{{ range $name, $items := .Site.Taxonomies.categories }}
<li><a href="{{ $.Site.BaseURL }}categories/{{ $name | urlize | lower }}">{{ $name }} &nbsp;<span>({{ len $items }})</span></a></li>
{{ end }}