chore: deduplicate permalinks; fix sitemap; organize

This commit is contained in:
Cory Dransfeldt 2024-07-15 22:52:57 -07:00
parent b40986256a
commit ae1cb3dc5e
No known key found for this signature in database
64 changed files with 94 additions and 31 deletions

View file

@ -0,0 +1,20 @@
{%- assign categoryUrl = url | downcase -%}
{% if categoryUrl | isLinkActive: page.url %}
<span class="active {{ class }}" aria-current="page">
{% if icon %}
{% tablericon icon title %}
<span>{{ title }}</span>
{% else %}
{{ title }}
{% endif %}
</span>
{% else %}
<a class="{% if icon %}{{ icon | downcase }} icon {% endif %}{{ class }}" href="{{ categoryUrl }}" tabindex="0">
{% if icon %}
{% tablericon icon title %}
<span>{{ title }}</span>
{% else %}
{{ title }}
{% endif %}
</a>
{% endif %}

View file

@ -0,0 +1,8 @@
<a
class="{{ icon }}"
href="{{ url | downcase }}"
rel="me"
title="{{ title }}"
tabindex="0">
{% tablericon icon title %}
</a>

View file

@ -0,0 +1,17 @@
{% capture js %}
{% render "../../../assets/scripts/menu.js" %}
{% endcapture %}
<script>{{ js }}</script>
<div class="flex-centered">
<input id="menu-toggle" type="checkbox" aria-hidden="true" />
<label class="menu-button-container" for="menu-toggle" tabindex="0">
<div class="menu-closed" aria-hidden="true">{% tablericon "menu" "Menu closed" %}</div>
<div class="menu-open" aria-hidden="true">{% tablericon "x" "Menu open" %}</div>
</label>
<ul class="menu-primary" aria-label="Primary site navigation" id="primary-navigation">
{% for link in nav.primary %}
<li>{% render "partials/nav/link.liquid", page:page, title:link.title, url:link.permalink, icon:link.icon %}</li>
{% endfor %}
</ul>
{% render "partials/nav/theme-toggle.liquid" %}
</div>

View file

@ -0,0 +1,39 @@
<script type="module" src="/assets/scripts/components/select-pagination.js"></script>
<nav aria-label="Pagination" class="pagination flex-centered">
{% if pagination.href.previous %}
<a href="{{ pagination.href.previous }}" aria-label="Previous page">
{% tablericon "arrow-left" "Previous" %}
</a>
{% else %}
<span
class="disabled"
aria-label="Previous page (disabled)"
disabled>
{% tablericon "arrow-left" "Prevous" %}
</span>
{% endif %}
<select-pagination>
<select class="client-side" aria-label="Page selection">
{% for pageEntry in pagination.pages %}
<option value="{{ forloop.index | minus: 1 }}">{{ forloop.index }} of {{ pagination.links.size }}</option>
{% endfor %}
</select>
<noscript>
<div class="text-centered">
<span aria-current="page">{{ pagination.pageNumber | plus: 1 }}</span> of {{ pagination.links.size }}
</div>
</noscript>
</select-pagination>
{% if pagination.href.next %}
<a href="{{ pagination.href.next }}" aria-label="Next page">
{% tablericon "arrow-right" "Next" %}
</a>
{% else %}
<span
class="disabled"
aria-label="Next page (disabled)"
disabled>
{% tablericon "arrow-right" "Next" %}
</span>
{% endif %}
</nav>

View file

@ -0,0 +1,13 @@
<script type="module" src="/assets/scripts/components/theme-toggle.js" crossorigin="anonymous"></script>
<span class="client-side">
<theme-toggle>
<button class="theme-toggle" tabindex="0">
<span class="light">
{% tablericon "sun" "Toggle light theme" %}
</span>
<span class="dark">
{% tablericon "moon" "Toggle dark theme" %}
</span>
</button>
</theme-toggle>
</span>