aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVeikka Kähkönen <veikka.kahkonen@corefactory.com>2017-11-30 21:40:52 +0200
committerVeikka Kähkönen <veikka.kahkonen@corefactory.com>2017-11-30 21:40:52 +0200
commit9efb9955f2d172fb8856da5034d6a7258c1238cc (patch)
treea3900e76f9761f8975968ed00432531b2d61008d
parent71cf26438551cc0f0b0021cb09ddb2902dcd103a (diff)
Add support for absolute links in navi
...for external links.
-rw-r--r--_includes/header.html14
1 files changed, 12 insertions, 2 deletions
diff --git a/_includes/header.html b/_includes/header.html
index 7139c89..1304edc 100644
--- a/_includes/header.html
+++ b/_includes/header.html
@@ -17,8 +17,13 @@
{% else %}
{% assign current_page = false %}
{% endif %}
+ {% if item.absolute %}
+ {% assign absolute_href = item.href %}
+ {% else %}
+ {% assign absolute_href = item.href | absolute_url %}
+ {% endif %}
<li class="navigation__item {% if current_page %}active{% endif %}">
- <a href="{{ item.href | absolute_url }}">{{ item.title }}</a>
+ <a href="{{ absolute_href }}">{{ item.title }}</a>
</li>
{% if current_page and item.subnavi %}
{% assign subnavi = item.subnavi %}
@@ -31,8 +36,13 @@
<nav id="navigation_sub" class="navigation subheader__navigation">
<ul>
{% for subitem in subnavi.items %}
+ {% if subitem.absolute %}
+ {% assign absolute_href = subitem.href %}
+ {% else %}
+ {% assign absolute_href = main_page_href | absolute_url | append: subitem.href }} %}
+ {% endif %}
<li class="navigation__item {% if subitem.href == subpage_href %}active{% endif %}">
- <a href="{{ main_page_href | absolute_url }}{{ subitem.href }}">{{ subitem.title }}</a>
+ <a href="{{ absolute_href }}">{{ subitem.title }}</a>
</li>
{% endfor %}
</ul>