{{ if and ($.Param "enableSidebarCategories") (ne (len .Site.Taxonomies.categories) 0) }}
<div class="taxo">
    <section>
        <span class="title p2">
            <a href="{{ "/categories/" | relLangURL }}" class="taxo__title">
                {{ i18n "categories" }}
            </a>
        </span>
        {{ $minItemsToShowInTagCloud := $.Site.Params.minItemsToShowInTagCloud }}
        {{ range $index, $element := .Site.Taxonomies.categories }}
        {{ if and $index (ge (len $element) $minItemsToShowInTagCloud) }}
            <span class="tag">
                <a href="{{ $element.Page.RelPermalink }}" class="is-categories taxo__link" data-dir="{{ if ne ($.Param "languagedir") "rtl" }}ltr{{ else }}rtl{{ end }}">
                    <span class="taxo__text">
                        {{ $element.Page.Title }}
                    </span>
                    <span class="taxo__num" dir="auto">
                        {{ printf "%#v" (len $element) }}
                    </span>
                </a>
            </span>
        {{ end }}
        {{ end }}
    </section>
</div>
{{ end }}