swedbank-pay-design-guide-jekyll-theme 1.9.2 → 1.9.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7d576204f0905f4ad97a12cbbf4a5bef4b2efed40fd24728f315ef29aa1bdee2
4
- data.tar.gz: 76f4c8c9d616c993a50db2b83ef1d186d422222199f5063ec6273c0e247531ce
3
+ metadata.gz: bb6399fcb6768466d3a79fa48d7cc148786b6b16e7f2e5116d1d577998b1e411
4
+ data.tar.gz: cf030d126581b3a457204ed655035da20a36308c1cb93297595d1d38c5ca99db
5
5
  SHA512:
6
- metadata.gz: 9a1b3b671e7effeb8b76fc0d501a9bed6b4ddf9a918c88fe2f50e23ddb539f901d7905bef61784d86141b8f4e2bc434391a480dd7274ebc1256188618f1b28ba
7
- data.tar.gz: '09e20f7c41ac0c68eca729641ede6287ec05e9c1f101dd62d3ba33e4f2e523b9eda1f2527170c1f590b297a96ab4d057af44e0f8b3d44cd5fe35339a20e1670d'
6
+ metadata.gz: 14f293bdd5a8913d5fc292eb70d26708a212e2fbe106715495feabb2569311e45287618a881864116964280f3c8a4915b965a59ac95ee1cf681c1b9c38e93672
7
+ data.tar.gz: 40621213c12b27023e3c48ad1387e315cf2ec96e67d00d20abdacb813d34a86fd9eb3478dda9f4a279d220ff03a9183f0aeca81d86abbb80419e12775db96568
@@ -4,7 +4,7 @@ module Gem
4
4
  # Gem Specification
5
5
  class Specification
6
6
  def self.gem_version
7
- '1.9.2'
7
+ '1.9.3'
8
8
  end
9
9
  end
10
10
  end
@@ -44,7 +44,7 @@ module SwedbankPay
44
44
  # If we're rendering a leaf node, just set the level to a non-zero value
45
45
  # to get the 'nav-subgroup' class and such.
46
46
  level = is_leaf ? -1 : page.level
47
- title_markup = title_markup(page, level)
47
+ title_markup = title_markup(page, level, is_leaf)
48
48
  item_class = item_class(page, current_page, level, is_leaf)
49
49
  group_heading_class = group_heading_class(level)
50
50
 
@@ -73,11 +73,12 @@ module SwedbankPay
73
73
  "#{group_class}-heading"
74
74
  end
75
75
 
76
- def title_markup(page, level)
76
+ def title_markup(page, level, is_leaf)
77
77
  lead_title = lead_title(page)
78
78
  return "<span>#{lead_title}</span>" if level.zero?
79
79
 
80
- main_title = main_title(page)
80
+ main_title = main_title(page, is_leaf)
81
+
81
82
  "<a href=\"#{page.path}\">#{main_title}</a>"
82
83
  end
83
84
 
@@ -126,14 +127,28 @@ module SwedbankPay
126
127
  ''
127
128
  end
128
129
 
129
- def main_title(page)
130
+ def main_title(page, is_leaf)
130
131
  unless page.nil? || page.title.nil?
131
- main = page.title.main
132
+ lead_title = lead_title(page)
133
+ parent_lead_title = parent_lead_title(page)
134
+ main_title = page.title.main
135
+
136
+ # If the lead title is different to the parent's or we're not on a leaf
137
+ # node item, use the lead title as the main title. This causes 'section: Card'
138
+ # to be used as title for the Card item, but allows the nav-subgroup-heading
139
+ # 'Introduction' item to use the main title 'Introduction'.
140
+ main_title = lead_title unless lead_title == parent_lead_title || is_leaf
132
141
 
133
- return main || page.title.to_s
142
+ return main_title || page.title.to_s
134
143
  end
135
144
 
136
145
  ''
137
146
  end
147
+
148
+ def parent_lead_title(page)
149
+ return page.parent.title.lead unless page.parent.nil? || page.parent.title.nil?
150
+
151
+ nil
152
+ end
138
153
  end
139
154
  end
@@ -72,12 +72,11 @@ module SwedbankPay
72
72
 
73
73
  # Return the 'section' front matter if it can be found on the current page.
74
74
  section = section_from_front_matter(page)
75
+
75
76
  return section unless section.nil?
76
77
 
77
78
  # Recurse upwards to the root (until there is no parent).
78
- return find_section(page.parent) unless page.nil? || page.parent.nil? || !page.parent.is_a?(SidebarPage)
79
-
80
- nil
79
+ section_from_parent(page)
81
80
  end
82
81
 
83
82
  def section_from_front_matter(page)
@@ -89,7 +88,7 @@ module SwedbankPay
89
88
  def section_from_parent(page)
90
89
  return nil if page.nil? || page.parent.nil?
91
90
 
92
- find_section(page.parent, level) unless page.nil? || page.parent.nil?
91
+ find_section(page.parent) unless page.nil? || page.parent.nil?
93
92
  end
94
93
  end
95
94
  end
@@ -13,8 +13,9 @@ module SwedbankPay
13
13
 
14
14
  def to_s
15
15
  name = @page.name == '/' ? '/' : "/#{@page.name}"
16
- title = @page.title.nil? ? '?' : @page.title.main
17
- s = "#{indent} #{@page.coordinate}. #{name}: #{title}\n"
16
+ lead_title = @page.title.nil? ? '?' : @page.title.lead
17
+ main_title = @page.title.nil? ? '?' : @page.title.main
18
+ s = "#{indent} #{@page.coordinate}. #{name}: #{lead_title} – #{main_title}\n"
18
19
 
19
20
  if @page.children?
20
21
  @page.children.each do |child|
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: swedbank-pay-design-guide-jekyll-theme
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.2
4
+ version: 1.9.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Swedbank Pay
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-11-04 00:00:00.000000000 Z
11
+ date: 2020-11-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday