<div class="col-lg-12 col-md-6">
  <!-- category -->
  <div class="widget">
    <h2 class="section-title mb-3">{{i18n `categories`}}</h2>
    <div class="widget-body">
      {{ if isset .Site.Taxonomies "categories" }}
      {{ if not (eq (len site.Taxonomies.categories) 0) }}
      <ul class="widget-list">
        {{ range $name, $items := site.Taxonomies.categories }}<li><a href="{{`categories/` | relLangURL}}{{ $name | urlize | lower }}">{{ if index (split $name "/") 2 }}{{index (split $name "/") 2}}{{ else if index (split $name "/") 1 }}{{index (split $name "/") 1}}{{else}}{{index (split $name "/") 0}}{{end}}<span class="ml-auto">({{len $items}})</span></a></li>{{ end }}
      </ul>
      {{ end }}
      {{ end }}
    </div>
  </div>
</div>