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,6 +1,6 @@
<!-- <!--
Include this file in your templates so you can reference assets with relative urls Include this file in your templates so you can reference assets with relative urls
{% include base.html %} include base.html
example: href="{{ base }}/assets/css/style.css" example: href="{{ base }}/assets/css/style.css"
--> -->
{% assign base = '' %} {% assign base = '' %}

View file

@ -1,16 +1,4 @@
{% assign base = '' %} {% include base.html %}
{% 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 %}
<!-- <!--
To change the logo color, pass the parameter in the include. To change the logo color, pass the parameter in the include.

View file

@ -1,16 +1,4 @@
{% assign base = '' %} {% include base.html %}
{% 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 %}
<nav class="overlay-menu"> <nav class="overlay-menu">
<ul> <ul>

View file

@ -1,19 +1,7 @@
<!doctype html> <!doctype html>
<html> <html>
<head> <head>
{% assign base = '' %} {% include base.html %}
{% 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 %}
<meta charset="UTF-8"> <meta charset="UTF-8">
<title>{% if page.title %}{% t page.title %} &mdash; {% endif %}Dash</title> <title>{% if page.title %}{% t page.title %} &mdash; {% endif %}Dash</title>
<meta name="description" content="{% t page.description %}"> <meta name="description" content="{% t page.description %}">