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 +4 -4
- data/lib/gem_version.rb +1 -1
- data/lib/sidebar_html_builder.rb +21 -6
- data/lib/sidebar_page_title.rb +3 -4
- data/lib/sidebar_text_builder.rb +3 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bb6399fcb6768466d3a79fa48d7cc148786b6b16e7f2e5116d1d577998b1e411
|
4
|
+
data.tar.gz: cf030d126581b3a457204ed655035da20a36308c1cb93297595d1d38c5ca99db
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 14f293bdd5a8913d5fc292eb70d26708a212e2fbe106715495feabb2569311e45287618a881864116964280f3c8a4915b965a59ac95ee1cf681c1b9c38e93672
|
7
|
+
data.tar.gz: 40621213c12b27023e3c48ad1387e315cf2ec96e67d00d20abdacb813d34a86fd9eb3478dda9f4a279d220ff03a9183f0aeca81d86abbb80419e12775db96568
|
data/lib/gem_version.rb
CHANGED
data/lib/sidebar_html_builder.rb
CHANGED
@@ -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
|
-
|
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
|
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
|
data/lib/sidebar_page_title.rb
CHANGED
@@ -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
|
-
|
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
|
91
|
+
find_section(page.parent) unless page.nil? || page.parent.nil?
|
93
92
|
end
|
94
93
|
end
|
95
94
|
end
|
data/lib/sidebar_text_builder.rb
CHANGED
@@ -13,8 +13,9 @@ module SwedbankPay
|
|
13
13
|
|
14
14
|
def to_s
|
15
15
|
name = @page.name == '/' ? '/' : "/#{@page.name}"
|
16
|
-
|
17
|
-
|
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.
|
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-
|
11
|
+
date: 2020-11-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|