From 444d4cf4d726862695ac5a8c333337aea17cc8de Mon Sep 17 00:00:00 2001 From: Igor Kuzmenko Date: Mon, 31 Jul 2017 22:40:31 +0200 Subject: [PATCH] Fixes an issue with URLs like /web/web/ --- _includes/layout/base/wallets-list.html | 5 +++++ _includes/layout/base/wallets-menu.html | 2 +- _layouts/wallet-container.html | 5 +++++ _plugins/wallets.rb | 12 ++++++++++-- 4 files changed, 21 insertions(+), 3 deletions(-) diff --git a/_includes/layout/base/wallets-list.html b/_includes/layout/base/wallets-list.html index 8c9bdc61..92271549 100644 --- a/_includes/layout/base/wallets-list.html +++ b/_includes/layout/base/wallets-list.html @@ -9,8 +9,13 @@ http://opensource.org/licenses/MIT. {% assign os = page.os['name'] %} {% if wallet.compat contains platform and wallet.compat contains os %}
+ {% if platform == os %} + + {% else %} + {% endif %} {{ wallet.title }} {{ wallet.titleshort }} diff --git a/_includes/layout/base/wallets-menu.html b/_includes/layout/base/wallets-menu.html index 26f13d83..39c6f071 100644 --- a/_includes/layout/base/wallets-menu.html +++ b/_includes/layout/base/wallets-menu.html @@ -27,7 +27,7 @@ http://opensource.org/licenses/MIT. {% endif %}
  • {% if platformName == 'hardware' or platformName == 'web' %} - {% assign platformHref = "/" | append: page.lang | append: "/wallets/" | append: platformName | append: "/" | append: platformName | append: "/" %} + {% assign platformHref = "/" | append: page.lang | append: "/wallets/" | append: platformName | append: "/" %} {% translate walletcat{{platformName}} choose-your-wallet %} {% else %} {% translate walletcat{{platformName}} choose-your-wallet %} diff --git a/_layouts/wallet-container.html b/_layouts/wallet-container.html index dc6ed802..037b6198 100644 --- a/_layouts/wallet-container.html +++ b/_layouts/wallet-container.html @@ -27,8 +27,13 @@ max_wallet_text_length: 418 ## Unicode characters {% if page.id contains os.name %} {% assign btnClass = btnClass | append: " active" %} {% endif %} + {% if platform.name == os.name %} + + {% else %} + {% endif %} {% translate platform{{os.name}} choose-your-wallet %}{% translate walletcat{{os.name}} choose-your-wallet %} diff --git a/_plugins/wallets.rb b/_plugins/wallets.rb index c7c58e09..895ebad2 100644 --- a/_plugins/wallets.rb +++ b/_plugins/wallets.rb @@ -79,7 +79,11 @@ module Jekyll data = YAML.load_file(file) platform = data['platform'] os = data['os'] - dir = File.join(platform['name'], os['name']) + if platform['name'] == os['name'] + dir = File.join(platform['name']) + else + dir = File.join(platform['name'], os['name']) + end platformTitle = locs[lang]['choose-your-wallet']['walletcat' + platform['name']] osTitle = locs[lang]['choose-your-wallet']['platform' + os['name']] @@ -103,7 +107,11 @@ module Jekyll # This allows generation only of valid wallet pages if platform['name'] - dir = File.join(platform['name'], os['name'], wallet['id']) + if platform['name'] == os['name'] + dir = File.join(platform['name'], wallet['id']) + else + dir = File.join(platform['name'], os['name'], wallet['id']) + end platformTitle = locs[lang]['choose-your-wallet']['walletcat' + platform['name']] osTitle = locs[lang]['choose-your-wallet']['platform' + os['name']]