{{ if .Site.Params.widgets.categories }}
{{ if isset .Site.Taxonomies "categories" }}
{{ if not (eq (len .Site.Taxonomies.categories) 0) }}
<div class="panel panel-default sidebar-menu">

    <div class="panel-heading">
      <h3 class="panel-title">{{ i18n "categoriesTitle" }}</h3>
    </div>

    <div class="panel-body">
        <ul class="nav nav-pills nav-stacked">
            {{ range $name, $items := .Site.Taxonomies.categories }}
            <li><a href="{{ $.Site.BaseURL }}categories/{{ $name | urlize | lower }}">{{ $name }} ({{ len $items }})</a>
            </li>
            {{ end }}
        </ul>
    </div>
</div>
{{ end }}
{{ end }}
{{ end }}
