Add external class to https:// links in navbar/footer

This commit is contained in:
daudix
2024-10-29 02:15:23 +03:00
parent 0eedcc39e9
commit 6c405946c6
3 changed files with 4 additions and 12 deletions

View File

@ -28,10 +28,7 @@
{%- for link in link.menu -%}
{%- if link.url is matching('https?://') %}
<li>
<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 -%}>
<a href="{{ link.url }}" rel="{{ rel_attributes }}" class="external">
{{- macros_translate::translate(key=link.name, default=link.name, language_strings=language_strings) -}}
</a>
</li>
@ -51,10 +48,7 @@
</li>
{%- elif link.url is matching('https?://') %}
<li>
<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 -%}>
<a href="{{ link.url }}" rel="{{ rel_attributes }}" class="external">
{{- macros_translate::translate(key=link.name, default=link.name, language_strings=language_strings) -}}
</a>
</li>