Use relative_url and absolute_url where possible (#2387)
* Use relative_url and absolute_url where possible Drops the `contains "://"` check, adopt Jekyll 3.7 Ref: https://github.com/mmistakes/minimal-mistakes/pull/2385#issuecomment-579882236 * One more unneeded {% assign %} * Remove one more assign as noted by mmistakes * Consolidate 4 more captures * Consolidate an extra assign on "active" class
This commit is contained in:
@@ -13,13 +13,8 @@
|
||||
</a>
|
||||
<ul class="visible-links">
|
||||
{%- for link in site.data.navigation.main -%}
|
||||
{%- if link.url contains '://' -%}
|
||||
{%- assign url = link.url -%}
|
||||
{%- else -%}
|
||||
{%- assign url = link.url | relative_url -%}
|
||||
{%- endif -%}
|
||||
<li class="masthead__menu-item">
|
||||
<a href="{{ url }}" {% if link.description %}title="{{ link.description }}"{% endif %}>{{ link.title }}</a>
|
||||
<a href="{{ link.url | relative_url }}"{% if link.description %} title="{{ link.description }}"{% endif %}>{{ link.title }}</a>
|
||||
</li>
|
||||
{%- endfor -%}
|
||||
</ul>
|
||||
|
||||
Reference in New Issue
Block a user