Including the base.html for relative links.

This commit is contained in:
Perry Woodin 2016-07-14 14:38:36 -04:00
parent 01c297d5e7
commit 13ac889ada
4 changed files with 4 additions and 40 deletions

View file

@ -1,16 +1,4 @@
{% assign base = '' %}
{% assign depth = page.url | split: '/' | size | minus: 1 %}
{% if depth == -1 %}{% assign base = '.' %}
{% elsif depth == 1 %}{% assign base = '..' %}
{% elsif depth == 2 %}{% assign base = '../..' %}
{% elsif depth == 3 %}{% assign base = '../../..' %}
{% elsif depth == 4 %}{% assign base = '../../../..' %}{% endif %}
{% if site.lang != "en" %}
{% assign base = base | prepend: '../' %}
{% endif %}
{% capture basenav %}{{ base }}{% if site.lang != "en" %}/{{ site.lang }}{% endif %}{% endcapture %}
{% include base.html %}
<!--
To change the logo color, pass the parameter in the include.