~xdavidwu/xdavidwu.link

68c4a1f352b5432c238c0474b0696bab831c658e — Luc Sarzyniec 6 years ago f5c7d96
Fix: use relative links for menu items when possible (#1783) (#1784)

1 files changed, 9 insertions(+), 9 deletions(-)

M _includes/masthead.html
M _includes/masthead.html => _includes/masthead.html +9 -9
@@ 4,16 4,16 @@
      <nav id="site-nav" class="greedy-nav">
        <a class="site-title" href="{{ '/' | relative_url }}">{{ site.title }}</a>
        <ul class="visible-links">
          {% for link in site.data.navigation.main %}
            {% if link.url contains 'http' %}
              {% assign domain = '' %}
            {% else %}
              {% assign domain = site.url | append: site.baseurl %}
            {% endif %}
          {%- 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="{{ domain }}{{ link.url }}" {% if link.description %}title="{{ link.description }}"{% endif %}>{{ link.title }}</a>
              <a href="{{ url }}" {% if link.description %}title="{{ link.description }}"{% endif %}>{{ link.title }}</a>
            </li>
          {% endfor %}
          {%- endfor -%}
        </ul>
        {% if site.search == true %}
        <button class="search__toggle" type="button">


@@ 30,4 30,4 @@
      </nav>
    </div>
  </div>
</div>
\ No newline at end of file
</div>