From 9e9f643de8f62ad2b74b71776562c91552b4cc56 Mon Sep 17 00:00:00 2001 From: Felix Fennell Date: Tue, 14 Mar 2017 17:22:59 +0000 Subject: [PATCH 1/4] Preparing for next release --- CHANGELOG.md | 2 ++ jekyll-theme-bas-style-kit.gemspec | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1f9c370..4ce9e93 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,8 @@ This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html ## [Unreleased][unreleased] +## 0.1.1 - Skipped + ## 0.1.0 - 12/03/2017 ### Added diff --git a/jekyll-theme-bas-style-kit.gemspec b/jekyll-theme-bas-style-kit.gemspec index 0f4ed52..d6cca01 100644 --- a/jekyll-theme-bas-style-kit.gemspec +++ b/jekyll-theme-bas-style-kit.gemspec @@ -2,7 +2,7 @@ Gem::Specification.new do |spec| spec.name = "jekyll-theme-bas-style-kit" - spec.version = "0.1.1" + spec.version = "0.1.2" spec.authors = ["Felix Fennell"] spec.email = ["felnne@bas.ac.uk"] From 48d6c049f08129cc86fd0e39d695ad9f20374562 Mon Sep 17 00:00:00 2001 From: Felix Fennell Date: Tue, 14 Mar 2017 17:24:00 +0000 Subject: [PATCH 2/4] Initial fixes for using pretty permalinks Address issue #1 - whereby the active state is not correct applied in the site navigation when the pretty permalink scheme is used. This commit adds support for single items - more work is needed for dropdown items. --- _config.yml | 1 + _includes/layout/site-navigation.html | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) 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..3605b28 100644 --- a/_includes/layout/site-navigation.html +++ b/_includes/layout/site-navigation.html @@ -18,8 +18,9 @@ {% comment %} Single navbar items {% endcomment %} {% if item.type == 'single_item' %} {% assign page_url = page.url | remove: '.html' %} -
  • - {% if page_url == item.url %}(current){% endif %} + +
  • + {% if page_url == item.href %}(current){% endif %} {% unless page_url == '/' %}{% unless item.href == '/' %}{% if page_url + '/' == item.href %}(current){% endif %}{% endunless %}{% endunless %} {{ item.name }}
  • From 6749d259ec1bc810d673026bc3c69ea704777bf9 Mon Sep 17 00:00:00 2001 From: Felix Fennell Date: Tue, 14 Mar 2017 21:32:51 +0000 Subject: [PATCH 3/4] Fixing active site navigation item support Now works for dropdown_items. --- _includes/layout/site-navigation.html | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/_includes/layout/site-navigation.html b/_includes/layout/site-navigation.html index 3605b28..ae964a8 100644 --- a/_includes/layout/site-navigation.html +++ b/_includes/layout/site-navigation.html @@ -17,9 +17,9 @@ {% for item in site.nav_items %} {% comment %} Single navbar items {% endcomment %} {% if item.type == 'single_item' %} - {% assign page_url = page.url | remove: '.html' %} - -
  • + {% 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 }}
  • @@ -31,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 %}