diff --git a/CHANGELOG.md b/CHANGELOG.md index 1f9c370..e5d53e2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,14 @@ This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html ## [Unreleased][unreleased] +## 0.1.2 - 14/03/2017 + +### Fixed + +* Active site navigation item support when using 'pretty' permalinks + +## 0.1.1 - Skipped + ## 0.1.0 - 12/03/2017 ### Added diff --git a/_config.yml b/_config.yml index 5d79301..280d030 100644 --- a/_config.yml +++ b/_config.yml @@ -32,6 +32,7 @@ encoding: UTF-8 baseurl: "" # e.g. /foo url: "http://localhost:9000" # base hostname & protocol for canonical links +permalink: pretty title: BAS Style Kit Jekyll Theme description: > # Jekyll theme implementation of the BAS Style Kit - https://stlye-kit.web.bas.ac.uk. diff --git a/_includes/layout/site-navigation.html b/_includes/layout/site-navigation.html index adc90e5..ae964a8 100644 --- a/_includes/layout/site-navigation.html +++ b/_includes/layout/site-navigation.html @@ -17,9 +17,10 @@ {% for item in site.nav_items %} {% comment %} Single navbar items {% endcomment %} {% if item.type == 'single_item' %} - {% assign page_url = page.url | remove: '.html' %} -
  • - {% if page_url == item.url %}(current){% endif %} + {% assign page_url = page.url | remove: '.html' %} + {% assign item_url = item.href | append: '/' %} +
  • + {% if page_url == item.href %}(current){% endif %} {% unless page_url == '/' %}{% unless item.href == '/' %}{% if page_url + '/' == item.href %}(current){% endif %}{% endunless %}{% endunless %} {{ item.name }}
  • @@ -30,6 +31,10 @@ {% if page_url == action.href %} {% assign is_active = true %} {% endif %} + {% assign action_url = action.href | append: '/' %} + {% if page_url == action_url %} + {% assign is_active = true %} + {% endif %} {% endfor %}