chore: remove code duplication and clean up

This commit is contained in:
Cory Dransfeldt 2024-05-28 10:25:38 -07:00
parent 5a402c4def
commit 694dae0b06
No known key found for this signature in database
34 changed files with 246 additions and 292 deletions

View file

@ -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 %}