feat(): show categories and tags blocs only if there are some
This commit is contained in:
parent
b78846f55b
commit
5707d9da35
|
@ -9,21 +9,25 @@
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{{ with .Site.Taxonomies.tags }}
|
||||||
<div id="tags" class="open">
|
<div id="tags" class="open">
|
||||||
<h3 data-open="tags">{{ ( index $.Site.Data.translations $.Site.Params.locale ).tags }}</h3>
|
<h3 data-open="tags">{{ ( index $.Site.Data.translations $.Site.Params.locale ).tags }}</h3>
|
||||||
<ul class="tags">
|
<ul class="tags">
|
||||||
{{ range $name, $taxonomy := .Site.Taxonomies.tags }}
|
{{ range $name, $taxonomy := . }}
|
||||||
<li><a href="/tags/{{ $name | urlize }}">{{ $name }}</a></li>
|
<li><a href="/tags/{{ $name | urlize }}">{{ $name }}</a></li>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
|
{{ with .Site.Taxonomies.categories }}
|
||||||
<div id="categories" class="open">
|
<div id="categories" class="open">
|
||||||
<h3 data-open="categories">{{ ( index $.Site.Data.translations $.Site.Params.locale ).categories }}</h3>
|
<h3 data-open="categories">{{ ( index $.Site.Data.translations $.Site.Params.locale ).categories }}</h3>
|
||||||
<ul class="categories">
|
<ul class="categories">
|
||||||
{{ range $name, $taxonomy := .Site.Taxonomies.categories }}
|
{{ range $name, $taxonomy := . }}
|
||||||
<li><a href="/categories/{{ $name | urlize }}">{{ $name }}</a></li>
|
<li><a href="/categories/{{ $name | urlize }}">{{ $name }}</a></li>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
{{ end }}
|
||||||
</nav>
|
</nav>
|
||||||
|
|
Loading…
Reference in New Issue