Skip to content

Commit

Permalink
Fix breadcrumb links to Projects
Browse files Browse the repository at this point in the history
They were linking to a client-side redirect to `/#projects/` :(
ISSOtm committed Jan 20, 2025
1 parent 8b2dab0 commit c8ea9b9
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions templates/page.html
Original file line number Diff line number Diff line change
@@ -71,11 +71,21 @@ <h1 itemprop="headline">{{ page.title }}</h1>
{% for ancestor in page.ancestors %}
{% set_global elems = elems | concat(with=get_section(path=ancestor)) %}
{% endfor %}
{% set projects = get_section(path="projects/_index.md") %}
{% for elem in elems | concat(with=page) %}
<li itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem">
{% if not loop.last %} <a itemprop="item" href="{{ elem.permalink }}"> {% endif %}
{% if not loop.last %}
<a itemprop="item" href="{# Nasty hack to work around bad `redirect_to` handling #}
{%- if elem.permalink == projects.permalink -%}
{{ get_url(path='@/_index.md#projects') }}
{%- else -%}
{{ elem.permalink }}
{%- endif %}">
{% endif %}
<span itemprop="name">{{ elem.extra.breadcrumb | default(value=elem.title) | safe }}</span>
{% if not loop.last %} </a> {% endif %}
{% if not loop.last %}
</a>
{% endif %}
<meta itemprop="position" content="{{ loop.index }}"/>
</li>
{% endfor %}

0 comments on commit c8ea9b9

Please sign in to comment.