chore: remove code duplication and clean up
This commit is contained in:
parent
5a402c4def
commit
694dae0b06
34 changed files with 246 additions and 292 deletions
|
@ -1,4 +1,4 @@
|
|||
{%- capture categoryUrl %}/{{ link | downcase }}/{% endcapture -%}
|
||||
{%- assign categoryUrl = "/" | append: link | downcase -%}
|
||||
{% if categoryUrl | isLinkActive: page.url %}
|
||||
<span class="active {{ class }}" aria-current="page">
|
||||
{% if icon %}
|
||||
|
@ -9,14 +9,12 @@
|
|||
{% endif %}
|
||||
</span>
|
||||
{% else %}
|
||||
{% if icon %}
|
||||
<a class="{{ icon | downcase }} icon {{ class }}" href="/{{ link | downcase }}">
|
||||
<a class="{% if icon %}{{ icon | downcase }} icon {% endif %}{{ class }}" href="{{ categoryUrl }}">
|
||||
{% if icon %}
|
||||
{% tablericon icon link %}
|
||||
<span>{{ link }}</span>
|
||||
</a>
|
||||
{% else %}
|
||||
<a href="/{{ link | downcase }}">
|
||||
{% else %}
|
||||
{{ link }}
|
||||
</a>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</a>
|
||||
{% endif %}
|
Reference in a new issue