Strip surrounding slashes from nav link labels
Some checks failed
Build and Deploy / deploy (push) Failing after 31s
Some checks failed
Build and Deploy / deploy (push) Failing after 31s
This commit is contained in:
parent
f2ee6a68dd
commit
47b49fba99
1 changed files with 3 additions and 3 deletions
|
|
@ -58,17 +58,17 @@
|
||||||
{% set root_section = get_section(path="_index.md") %}
|
{% set root_section = get_section(path="_index.md") %}
|
||||||
<header>
|
<header>
|
||||||
<nav>
|
<nav>
|
||||||
<a href="/">/home/</a>
|
<a href="/">home</a>
|
||||||
|
|
||||||
{# Render subsections #}
|
{# Render subsections #}
|
||||||
{% for subsection_path in root_section.subsections %}
|
{% for subsection_path in root_section.subsections %}
|
||||||
{% set subsection = get_section(path=subsection_path) %}
|
{% 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 %}
|
{% endfor %}
|
||||||
|
|
||||||
{# Render pages at the root #}
|
{# Render pages at the root #}
|
||||||
{% for page in root_section.pages %}
|
{% 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 %}
|
{% endfor %}
|
||||||
</nav>
|
</nav>
|
||||||
</header>
|
</header>
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue