Page permalink can be an outside url (#2863)

Fixes #2858

---------

Signed-off-by: George Araújo <george.gcac@gmail.com>
This commit is contained in:
George 2024-11-28 15:32:13 -03:00 committed by GitHub
parent c170eaf2d0
commit 1c1632c8c9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -87,7 +87,10 @@
{% if child.title == 'divider' %} {% if child.title == 'divider' %}
<div class="dropdown-divider"></div> <div class="dropdown-divider"></div>
{% else %} {% else %}
<a class="dropdown-item {% if page.title == child.title %}active{% endif %}" href="{{ child.permalink | relative_url }}"> <a
class="dropdown-item {% if page.title == child.title %}active{% endif %}"
href="{% if child.permalink contains '://' %}{{ child.permalink }}{% else %}{{ child.permalink | relative_url }}{% endif %}"
>
{{- child.title -}} {{- child.title -}}
</a> </a>
{% endif %} {% endif %}
@ -97,7 +100,13 @@
{% else %} {% else %}
{% assign parent_link = p.permalink | remove: 'index.html' %} {% assign parent_link = p.permalink | remove: 'index.html' %}
<li class="nav-item {% if page.url contains parent_link %}active{% endif %}"> <li class="nav-item {% if page.url contains parent_link %}active{% endif %}">
{% if p.permalink contains '/blog/' %}{% assign url = '/blog/' %} {% else %}{% assign url = p.url %}{% endif %} {%- if p.permalink contains '://' -%}
{%- assign url = p.permalink -%}
{%- elsif p.permalink contains '/blog/' -%}
{%- assign url = '/blog/' -%}
{%- else -%}
{%- assign url = p['url-'] %}
{%- endif %}
<a class="nav-link" href="{{ url | relative_url }}"> <a class="nav-link" href="{{ url | relative_url }}">
{{- p.title }} {{- p.title }}
{% if page.url contains p.url %} {% if page.url contains p.url %}