Set rel attributes to links (fixes #40)

This commit is contained in:
daudix
2024-07-29 17:18:25 +03:00
parent 40b4198421
commit 7c176c09d2
8 changed files with 38 additions and 13 deletions

View File

@ -1,3 +1,5 @@
{%- set rel_attributes = macros_rel_attributes::rel_attributes() | trim -%}
<header id="site-nav">
<nav>
<a href="#main" id="main-content" tabindex="0">
@ -15,7 +17,7 @@
{%- for link in config.extra.nav.links %}
{%- if link.url is matching('https?://') %}
<li>
<a href="{{ link.url }}"
<a href="{{ link.url }}" rel="{{ rel_attributes }}"
{%- if current_url | default(value='/') | trim_end_matches(pat='/') | safe == link.url | trim_end_matches(pat='/') | safe -%}
class="active"
{%- endif -%}>