Hugo Category


原文链接: Hugo Category

分类及数量统计

       <div class="categories">
            <strong>{{ i18n "categories" }}</strong>

            {{ with .Site.Taxonomies.categories }}
                <ul>
                {{ range $name, $taxonomy := . }}
                    <li>
                        <a href="/categories/{{ $name | urlize }}">{{ $name | humanize }} ({{ $taxonomy.Count }})</a>
                    </li>
                {{ end }}
                </ul>
            {{ end }}
        </div>
`