feat(nav): refactor primary navigation to split labels + icons; remove redundant nav code
This commit is contained in:
parent
38992d10f1
commit
b6d5933433
23 changed files with 319 additions and 419 deletions
|
@ -1,8 +1,12 @@
|
|||
{%- assign categoryUrl = link.permalink | downcase -%}
|
||||
{%- assign isHttp = categoryUrl contains "http" -%}
|
||||
{%- if categoryUrl | isLinkActive:page.url -%}
|
||||
{%- capture linkClass -%}
|
||||
{%- if link.section -%}button{%- endif -%}
|
||||
{%- if link.icon -%}icon{%- endif -%}
|
||||
{%- endcapture -%}
|
||||
<span
|
||||
class="active {{ link.class }}"
|
||||
class="active {{ linkClass }}"
|
||||
aria-current="page"
|
||||
>
|
||||
{%- if link.icon -%}
|
||||
|
@ -14,7 +18,7 @@
|
|||
</span>
|
||||
{%- else -%}
|
||||
<a
|
||||
class="{% if link.icon %}{{ link.icon | downcase }} icon {% endif %}{{ link.class }}"
|
||||
class="{% if link.section %}{{ link.section | downcase }} button {% endif %}{% if link.icon %}{{ link.icon | downcase }} icon {% endif %}"
|
||||
href="{{ categoryUrl }}"
|
||||
{% if isHttp -%} rel="me" {%- endif %}
|
||||
title="{{ link.title }}"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue