39 lines
1.3 KiB
HTML
39 lines
1.3 KiB
HTML
|
{%- comment -%}
|
||
|
El ítem tiene un dropdown si tiene sub ítems o si tiene categorías.
|
||
|
{%- endcomment -%}
|
||
|
{%- assign dropdown = include.item.items | present -%}
|
||
|
{%- unless dropdown -%}
|
||
|
{%- assign dropdown = include.item.categories | present -%}
|
||
|
{%- endunless -%}
|
||
|
|
||
|
<div class="nav-item w-100 w-lg-auto {{ dropdown | value_if: 'dropdown d-flex flex-wrap' }}">
|
||
|
{%- comment -%}
|
||
|
La URL del item puede ser:
|
||
|
* El artículo vinculado
|
||
|
* El vínculo escrito manualmente
|
||
|
* La primera categoría de la lista
|
||
|
* La dirección propia (en el caso de categorías)
|
||
|
{%- endcomment -%}
|
||
|
<a
|
||
|
href="{{ include.item.post.url | default: include.item.link | default: include.item.categories[0].url | default: include.item.url }}"
|
||
|
class="nav-link flex-grow-1 flex-grow-lg-0">
|
||
|
{{ include.item.title }}
|
||
|
</a>
|
||
|
|
||
|
{%- if dropdown -%}
|
||
|
<button class="dropdown-toggle border-0 background-white w-5 w-lg-auto pl-lg-3"></button>
|
||
|
<div class="dropdown-menu w-100 w-lg-auto flex-grow-1 flex-grow-lg-0">
|
||
|
{% for item in include.item.items %}
|
||
|
{%- include_cached item.html item=item -%}
|
||
|
{% endfor %}
|
||
|
|
||
|
{%- comment -%}
|
||
|
Esto necesita `replace` en sutty-archives
|
||
|
{%- endcomment -%}
|
||
|
{%- for item in include.item.categories offset: 1 -%}
|
||
|
{%- include_cached item.html item=item -%}
|
||
|
{%- endfor -%}
|
||
|
</div>
|
||
|
{%- endif -%}
|
||
|
</div>
|