Strip surrounding slashes from nav link labels
Some checks failed
Build and Deploy / deploy (push) Failing after 31s

This commit is contained in:
Graham McIntire 2026-05-23 17:47:01 -05:00
parent f2ee6a68dd
commit 47b49fba99
No known key found for this signature in database
GPG key ID: F4ABF488E6029E59

View file

@ -58,17 +58,17 @@
{% set root_section = get_section(path="_index.md") %}
<header>
<nav>
<a href="/">/home/</a>
<a href="/">home</a>
{# Render subsections #}
{% for subsection_path in root_section.subsections %}
{% set subsection = get_section(path=subsection_path) %}
<a href="{{ subsection.permalink }}">{{ subsection.permalink | replace(from=config.base_url, to="") }}</a>
<a href="{{ subsection.permalink }}">{{ subsection.permalink | replace(from=config.base_url, to="") | trim_start_matches(pat="/") | trim_end_matches(pat="/") }}</a>
{% endfor %}
{# Render pages at the root #}
{% for page in root_section.pages %}
<a href="{{ page.permalink }}">{{ page.permalink | replace(from=config.base_url, to="") }}</a>
<a href="{{ page.permalink }}">{{ page.permalink | replace(from=config.base_url, to="") | trim_start_matches(pat="/") | trim_end_matches(pat="/") }}</a>
{% endfor %}
</nav>
</header>