swedbank-pay-design-guide-jekyll-theme 1.6.1.pre.PullRequest0137.pre.0039 → 1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c26b0eabffc611afbaad781f8d72936368a8dee5291b194cbc77fe8af4e255fe
4
- data.tar.gz: a80c722c91cc6d47d0e9fa0157e5649d6212c17b9e8c3cd482217e15217d1d54
3
+ metadata.gz: f57da44f36098220148d4eb99c223c18ee561ddd9de7525598ecadbad350032b
4
+ data.tar.gz: f7b47697a6b3aaf102e7ffa7a16309ae1afbc8045f1ce8d4014da83894011f0d
5
5
  SHA512:
6
- metadata.gz: b7ab6fcd2225a11d337551b927a4e8d5ba59e537dfbfe4a260e2fc741743ccda1332183a63dd859af95728f281ee86aa262d2bdc8d0d12aff0c8705e82c0b9b3
7
- data.tar.gz: d2805f7dc6b81d7c39e1fababddc80ed9c19b9ffee3207ede849efafb32f815bc4776e6c77312b6821f237464ac5c7ccfb445fc2f6ec2519c8bc88bf9d248b00
6
+ metadata.gz: 287ed527957eeb2e96fae0e305c6f060e1f1027a61f4ed592842c60eabb5d7feb19676ee1080a137526a5e23cf020a2deb749a7952eb502379e7621cfbff4112
7
+ data.tar.gz: 1729df6cf6f02226c310ce3e7ee0168b8718919a63b8d253bb6b907b4d3c7c90569246f688f073b85764d607819938285a86e991e38368a7fe7bfa264b84079e
@@ -1,5 +1,4 @@
1
1
  {%- assign title = page.title | default: "PayEx Design Guide theme for Jekyll" -%}
2
- {%- assign front_page = page.front_page | default: false -%}
3
2
  {%- assign description = page.opengraph.description | default: site.opengraph.description -%}
4
3
  {%- assign image = page.opengraph.image | default: site.opengraph.image -%}
5
4
  {%- assign github_branch = site.github.branch | default : "develop" -%}
@@ -80,14 +79,14 @@
80
79
  </div>
81
80
 
82
81
  <main class="doc-view col-xxl-10 col-lg-9">
83
- {% if front_page != true %}
82
+ {% if page.layout != 'front-page' %}
84
83
  {% assign title_lead = title | split: '–' | first %}
85
84
  {% assign title_main = title | split: '–' | last %}
86
85
  {% assign description = page.description %}
87
86
  {% assign estimated_read = page.estimated_read %}
88
87
  <div class="title-header">
89
88
  <div class="title-header-container
90
- {% if page.card_overview%} max-width-card-overview
89
+ {% if page.card_overview %} max-width-card-overview
91
90
  {% else %} max-width
92
91
  {% endif %}">
93
92
  {% if title_lead != title_main %}
@@ -106,8 +105,8 @@
106
105
  </div>
107
106
  </div>
108
107
  {% endif %}
109
- <div class="doc-container{% if front_page == true %} no-padding
110
- {% elsif page.card_overview%} normal-padding max-width-card-overview
108
+ <div class="doc-container{% if page.layout == 'front-page' %} no-padding
109
+ {% elsif page.card_overview %} normal-padding max-width-card-overview
111
110
  {% else %} normal-padding max-width
112
111
  {% endif %}">
113
112
  <article>
@@ -0,0 +1,112 @@
1
+ ---
2
+ layout: default
3
+ ---
4
+
5
+ {% assign show_merchants_bar = page.front_page.show_merchants_bar | default: false %}
6
+ {% assign front_page_title = page.front_page.title | default: 'developer portal' %}
7
+ {% assign front_page_hero = page.front_page.hero | default: "Welcome to the Swedbank Pay" %}
8
+ {% assign front_page_ingress = page.front_page.ingress | default: "Our developer portal gives you the full tool box for integrating our payment instruments and getting started with easy, flexible and safe payments on your e-commerce website." %}
9
+ {% assign front_page_start_heading = page.front_page.start_heading | default: "Start your integration" %}
10
+
11
+ <div class="front-page">
12
+ <div class="front-page-container">
13
+ <div class="front-page-top">
14
+ <div class="front-page-hero">
15
+ <h3>{{ front_page_hero }}</h3>
16
+ <div class="front-page-hero-name">
17
+ {<span>{{ front_page_title }}</span>}
18
+ </div>
19
+ <p>{{ front_page_ingress }}</p>
20
+ </div>
21
+ <div class="front-page-intro-cards">
22
+ <h2 id="front-page-start" class="heading-line heading-line-white">{{ front_page_start_heading }}</h2>
23
+ {% contentblock start %}
24
+ </div>
25
+ </div>
26
+ {% if show_merchants_bar == true %}
27
+ <div class="front-page-merchants">
28
+ <h6>Trusted by</h6>
29
+ <div class="merchants-container justify-content-xxl-between">
30
+ <a class="merchant-link">
31
+ {% include img/merchants/logo-schibsted.svg %}
32
+ </a>
33
+ <a class="merchant-link">
34
+ {% include img/merchants/logo-ica.svg %}
35
+ </a>
36
+ <a class="merchant-link">
37
+ {% include img/merchants/logo-elkjop.svg %}
38
+ </a>
39
+ <a class="merchant-link">
40
+ {% include img/merchants/logo-synsam.svg %}
41
+ </a>
42
+ <a class="merchant-link">
43
+ {% include img/merchants/logo-coop.svg %}
44
+ </a>
45
+ <a class="merchant-link">
46
+ {% include img/merchants/logo-svenskaspel.svg %}
47
+ </a>
48
+ <a class="merchant-link">
49
+ {% include img/merchants/logo-skanetrafiken.svg %}
50
+ </a>
51
+ </div>
52
+ </div>
53
+ </div>
54
+ {% endif %}
55
+ <a href="https://ecom.externalintegration.payex.com/pspdemoshop" class="front-page-demoshop">
56
+ <span class="front-page-demoshop-text">
57
+ <span class="h2">Try our Demoshop<span>.</span></span>
58
+ <span class="demoshop-text-description">
59
+ Unsure about how it all works? See how our checkout and payment methods are used
60
+ in practice!
61
+ </span>
62
+ </span>
63
+ <span class="front-page-demoshop-link">
64
+ <span class="h3">Go to the demoshop</span>
65
+ <i class="material-icons">arrow_forward</i>
66
+ <span class="demoshop-link-img">
67
+ <img class="demoshop-link-img-mobile d-md-none d-lg-flex d-xl-none d-xxl-flex"
68
+ src="/assets/img/demoshop-mobile.svg" alt="demoshop-mobile" />
69
+ <img class="demoshop-link-img-mobile d-none d-md-none d-lg-flex d-xl-none"
70
+ src="/assets/img/demoshop-mobile2.svg" alt="demoshop-mobile2" />
71
+ <img class="demoshop-link-img-web d-none d-sm-none d-md-flex d-lg-none d-xl-flex"
72
+ src="/assets/img/demoshop-web.svg" alt="demoshop-web" />
73
+ </span>
74
+ </span>
75
+ </a>
76
+
77
+ <div class="front-page-container">
78
+ <div class="front-page-cards-sdk">
79
+ {% contentblock sdks %}
80
+ </div>
81
+
82
+ <div class="front-page-cards-module">
83
+ {% contentblock modules %}
84
+ </div>
85
+
86
+ <div class="front-page-release-notes">
87
+ {% contentblock release_notes %}
88
+ </div>
89
+
90
+ <div class="front-page-cards-extra">
91
+ {% contentblock extras %}
92
+ </div>
93
+
94
+ <div class="front-page-contact">
95
+ <div class="front-page-contact-content">
96
+ <div class="row">
97
+ <div class="col-xl-7">
98
+ <h2 id="front-page-contact" class="heading-line heading-line-long">Can't find what you are
99
+ looking for?</h2>
100
+ <p>
101
+ We are always trying to make the developer portal as
102
+ good as it can be please don’t hesitate to contact us.
103
+ </p>
104
+ </div>
105
+ <div class="col-xl-5 d-flex align-items-center justify-content-center">
106
+ <button class="btn">Contact us here</button>
107
+ </div>
108
+ </div>
109
+ </div>
110
+ </div>
111
+ </div>
112
+ </div>
@@ -1,217 +1,2 @@
1
1
  # frozen_string_literal: false
2
-
3
- require 'jekyll'
4
- require 'nokogiri'
5
- require 'json'
6
-
7
- ###
8
- # This plugin works only if used as a remote-theme
9
- # If included as a theme or gem this plugin must be copied over
10
- ###
11
-
12
- module Jekyll
13
- class Sidebar
14
- safe true
15
- attr_accessor :hash_pre_render
16
- attr_accessor :filename_with_headers
17
-
18
- def initialize
19
- @hash_pre_render = {}
20
- @filename_with_headers = {}
21
- end
22
-
23
- def pre_render(page)
24
- menu_order = page['menu-order'].nil? ? 0 : page['menu-order']
25
- hide_from_sidebar = page['hide_from_sidebar'].nil? ? false : page['hide_from_sidebar']
26
- url = page['url'].gsub('index.html', '').gsub('.html', '')
27
- @hash_pre_render[url] = {
28
- title: page['title'],
29
- url: page['url'].gsub('.html', ''),
30
- name: page['name'],
31
- menu_order: menu_order,
32
- hide_from_sidebar: hide_from_sidebar
33
- }
34
- end
35
-
36
- def post_write(site)
37
- files = []
38
- Dir.glob("#{site.config['destination']}/**/*.html") do |filename|
39
- doc = File.open(filename) { |f| Nokogiri::HTML(f) }
40
- files.push(doc)
41
-
42
- headers = []
43
- doc.xpath('//h2 ').each do |header|
44
- next unless header['id']
45
-
46
- child = header.last_element_child
47
- header = {
48
- id: header['id'],
49
- title: header.content.strip,
50
- hash: (child['href']).to_s
51
- }
52
- headers.push(header)
53
- end
54
- sanitized_filename = sanitize_filename(filename)
55
- @filename_with_headers[sanitized_filename] = { headers: headers }
56
- end
57
-
58
- Dir.glob("#{site.config['destination']}/**/*.html") do |filename|
59
- sanitized_filename = sanitize_filename(filename)
60
- sidebar = render(sanitized_filename)
61
- file = File.open(filename) { |f| Nokogiri::HTML(f) }
62
- file.xpath('//*[@id="dx-sidebar-main-nav-ul"]').each do |location|
63
- location.inner_html = sidebar
64
- end
65
- File.open(filename, 'w') { |f| f.write(file.to_html(encoding: 'UTF-8')) }
66
- end
67
-
68
- # File.open('_site/sidebar.html', 'w') { |f| f.write(sidebar) }
69
- end
70
-
71
- private
72
-
73
- def sanitize_filename(filename)
74
- sanitized_filename = filename.match(/(?m)(?<=\b_site).*$/)[0]
75
- sanitized_filename = sanitized_filename.gsub('index.html', '')
76
- sanitized_filename.gsub('.html', '')
77
- end
78
-
79
- def generateSubgroup(filename, key, value, all_subgroups, level)
80
- title = value[:title].split('–').last
81
- subsubgroup_list = all_subgroups.select do |subsubgroup_key, _subsubgroup_value|
82
- subsubgroup_key.include? key and subsubgroup_key != key and \
83
- key.split('/').length > level
84
- end
85
-
86
- subgroup = ''
87
- has_subgroups = !all_subgroups.empty?
88
- if value[:headers].any? || !subsubgroup_list.empty?
89
- if has_subgroups
90
- url = value[:url]
91
- active = active?(filename, url, true)
92
- # puts "#{url}, #{filename}, #{key}" if active
93
- item_class = active || (url.split('/').length > level && filename.start_with?(url)) ? 'nav-subgroup active' : 'nav-subgroup'
94
- subgroup << "<li class=\"#{item_class}\">"
95
- subgroup << "<div class=\"nav-subgroup-heading\"><i class=\"material-icons\">arrow_right</i><a href=\"#{url}\">#{title}</a></div>"
96
- subgroup << '<ul class="nav-ul">'
97
-
98
- if subsubgroup_list.empty?
99
- value[:headers].each do |header|
100
- subgroup << "<li class=\"nav-leaf\"><a href=\"#{value[:url]}#{header[:hash]}\">#{header[:title]}</a></li>"
101
- end
102
- else
103
- subgroup_leaf_class = active ? 'nav-leaf nav-subgroup-leaf active' : 'nav-leaf nav-subgroup-leaf'
104
- subgroup << "<li class=\"#{subgroup_leaf_class}\"><a href=\"#{value[:url]}\">#{title} overview</a></li>"
105
-
106
- subsubgroup_list.each do |subsubgroup_key, subsubgroup_value|
107
- subgroup << generateSubgroup(filename, subsubgroup_key, subsubgroup_value, subsubgroup_list, 3)
108
- end
109
- end
110
-
111
- subgroup << '</ul>'
112
- subgroup << '</li>'
113
- else
114
- value[:headers].each do |header|
115
- subgroup << "<li class=\"nav-leaf\"><a href=\"#{value[:url]}#{header[:hash]}\">#{header[:title]}</a></li>"
116
- end
117
- end
118
- else
119
- subgroup << if has_subgroups
120
- "<li class=\"nav-leaf nav-subgroup-leaf\"><a href=\"#{value[:url]}\">#{title}</a></li>"
121
- else
122
- "<li class=\"nav-leaf\"><a href=\"#{value[:url]}\">#{title}</a></li>"
123
- end
124
- end
125
-
126
- subgroup
127
- end
128
-
129
- def render(filename)
130
- sidebar = ''
131
-
132
- merged = merge(@hash_pre_render, @filename_with_headers).sort_by { |_key, value| value[:menu_order] }
133
- merged.select { |key, _value| key.split('/').length <= 2 }.each do |key, value|
134
- next if value[:title].nil?
135
- next if value[:hide_from_sidebar]
136
-
137
- subgroups = merged.select { |subgroup_key, _subgroup_value| subgroup_key.include? key and subgroup_key != key and key != '/' }
138
-
139
- active = active?(filename, key)
140
- # puts "#{filename}, #{key}" if active
141
- item_class = active ? 'nav-group active' : 'nav-group'
142
-
143
- child = "<li class=\"#{item_class}\">"
144
- child << "<div class=\"nav-group-heading\"><i class=\"material-icons\">arrow_right</i><span>#{value[:title].split('–').first}</span></div>"
145
-
146
- child << '<ul class="nav-ul">'
147
-
148
- subgroup = generateSubgroup(filename, key, value, subgroups, 2)
149
-
150
- child << subgroup
151
-
152
- if subgroups.any?
153
- subgroups.select { |subgroup_key, _subgroup_value| subgroup_key.split('/').length <= 3 }.each do |subgroup_key, subgroup_value|
154
- subgroup = generateSubgroup(filename, subgroup_key, subgroup_value, subgroups, 2)
155
- child << subgroup
156
- end
157
- end
158
-
159
- child << '</ul>'
160
- child << '</li>'
161
- sidebar << child
162
- end
163
-
164
- File.open('_site/sidebar.html', 'w') { |f| f.write(sidebar) }
165
- sidebar
166
- end
167
-
168
- def active?(filename, url, exact = false)
169
- if filename == '/' || url == '/'
170
- if filename == '/' && url == '/'
171
- return true
172
- else
173
- return false
174
- end
175
- end
176
-
177
- exact ? filename == url : filename.start_with?(url)
178
- end
179
-
180
- def merge(hash1, hash2)
181
- all_keys = hash1.keys | hash2.keys
182
- result_hash = {}
183
-
184
- all_keys.each do |key|
185
- hash_value = {}
186
-
187
- if hash1.key? key
188
- value = hash1[key]
189
-
190
- hash_value = value unless value.nil?
191
- end
192
-
193
- if hash2.key? key
194
- value = hash2[key]
195
-
196
- hash_value = hash_value.merge(value) unless value.nil?
197
- end
198
-
199
- result_hash[key] = hash_value
200
- end
201
-
202
- result_hash
203
- end
204
- end
205
- end
206
-
207
- sidebar = Jekyll::Sidebar.new
208
-
209
- Jekyll::Hooks.register :site, :pre_render do |site, _payload|
210
- site.pages.each do |page|
211
- sidebar.pre_render page
212
- end
213
- end
214
-
215
- Jekyll::Hooks.register :site, :post_write do |site|
216
- sidebar.post_write site
217
- end
2
+ require_relative '../lib/sidebar.rb'
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Gem
4
+ # Gem Specification
5
+ class Specification
6
+ def self.gem_version
7
+ '1.8'
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,211 @@
1
+ # frozen_string_literal: false
2
+
3
+ require 'jekyll'
4
+ require 'nokogiri'
5
+ require 'json'
6
+
7
+ module Jekyll
8
+ class Sidebar
9
+ attr_accessor :hash_pre_render
10
+ attr_accessor :filename_with_headers
11
+
12
+ def initialize
13
+ @hash_pre_render = {}
14
+ @filename_with_headers = {}
15
+ end
16
+
17
+ def pre_render(page)
18
+ menu_order = page['menu-order'].nil? ? 0 : page['menu-order']
19
+ hide_from_sidebar = page['hide_from_sidebar'].nil? ? false : page['hide_from_sidebar']
20
+ url = page['url'].gsub('index.html', '').gsub('.html', '')
21
+ @hash_pre_render[url] = {
22
+ title: page['title'],
23
+ url: page['url'].gsub('.html', ''),
24
+ name: page['name'],
25
+ menu_order: menu_order,
26
+ hide_from_sidebar: hide_from_sidebar
27
+ }
28
+ end
29
+
30
+ def post_write(site)
31
+ files = []
32
+ Dir.glob("#{site.config['destination']}/**/*.html") do |filename|
33
+ doc = File.open(filename) { |f| Nokogiri::HTML(f) }
34
+ files.push(doc)
35
+
36
+ headers = []
37
+ doc.xpath('//h2 ').each do |header|
38
+ next unless header['id']
39
+
40
+ child = header.last_element_child
41
+ header = {
42
+ id: header['id'],
43
+ title: header.content.strip,
44
+ hash: (child['href']).to_s
45
+ }
46
+ headers.push(header)
47
+ end
48
+ sanitized_filename = sanitize_filename(filename)
49
+ @filename_with_headers[sanitized_filename] = { headers: headers }
50
+ end
51
+
52
+ Dir.glob("#{site.config['destination']}/**/*.html") do |filename|
53
+ sanitized_filename = sanitize_filename(filename)
54
+ sidebar = render(sanitized_filename)
55
+ file = File.open(filename) { |f| Nokogiri::HTML(f) }
56
+ file.xpath('//*[@id="dx-sidebar-main-nav-ul"]').each do |location|
57
+ location.inner_html = sidebar
58
+ end
59
+ File.open(filename, 'w') { |f| f.write(file.to_html(encoding: 'UTF-8')) }
60
+ end
61
+
62
+ # File.open('_site/sidebar.html', 'w') { |f| f.write(sidebar) }
63
+ end
64
+
65
+ private
66
+
67
+ def sanitize_filename(filename)
68
+ sanitized_filename = filename.match(/(?m)(?<=\b_site).*$/)[0]
69
+ sanitized_filename = sanitized_filename.gsub('index.html', '')
70
+ sanitized_filename.gsub('.html', '')
71
+ end
72
+
73
+ def generateSubgroup(filename, key, value, all_subgroups, level)
74
+ title = value[:title].split('–').last
75
+ subsubgroup_list = all_subgroups.select do |subsubgroup_key, _subsubgroup_value|
76
+ subsubgroup_key.include? key and subsubgroup_key != key and \
77
+ key.split('/').length > level
78
+ end
79
+
80
+ subgroup = ''
81
+ has_subgroups = !all_subgroups.empty?
82
+ if value[:headers].any? || !subsubgroup_list.empty?
83
+ if has_subgroups
84
+ url = value[:url]
85
+ active = active?(filename, url, true)
86
+ # puts "#{url}, #{filename}, #{key}" if active
87
+ item_class = active || (url.split('/').length > level && filename.start_with?(url)) ? 'nav-subgroup active' : 'nav-subgroup'
88
+ subgroup << "<li class=\"#{item_class}\">"
89
+ subgroup << "<div class=\"nav-subgroup-heading\"><i class=\"material-icons\">arrow_right</i><a href=\"#{url}\">#{title}</a></div>"
90
+ subgroup << '<ul class="nav-ul">'
91
+
92
+ if subsubgroup_list.empty?
93
+ value[:headers].each do |header|
94
+ subgroup << "<li class=\"nav-leaf\"><a href=\"#{value[:url]}#{header[:hash]}\">#{header[:title]}</a></li>"
95
+ end
96
+ else
97
+ subgroup_leaf_class = active ? 'nav-leaf nav-subgroup-leaf active' : 'nav-leaf nav-subgroup-leaf'
98
+ subgroup << "<li class=\"#{subgroup_leaf_class}\"><a href=\"#{value[:url]}\">#{title} overview</a></li>"
99
+
100
+ subsubgroup_list.each do |subsubgroup_key, subsubgroup_value|
101
+ subgroup << generateSubgroup(filename, subsubgroup_key, subsubgroup_value, subsubgroup_list, 3)
102
+ end
103
+ end
104
+
105
+ subgroup << '</ul>'
106
+ subgroup << '</li>'
107
+ else
108
+ value[:headers].each do |header|
109
+ subgroup << "<li class=\"nav-leaf\"><a href=\"#{value[:url]}#{header[:hash]}\">#{header[:title]}</a></li>"
110
+ end
111
+ end
112
+ else
113
+ subgroup << if has_subgroups
114
+ "<li class=\"nav-leaf nav-subgroup-leaf\"><a href=\"#{value[:url]}\">#{title}</a></li>"
115
+ else
116
+ "<li class=\"nav-leaf\"><a href=\"#{value[:url]}\">#{title}</a></li>"
117
+ end
118
+ end
119
+
120
+ subgroup
121
+ end
122
+
123
+ def render(filename)
124
+ sidebar = ''
125
+
126
+ merged = merge(@hash_pre_render, @filename_with_headers).sort_by { |_key, value| value[:menu_order] }
127
+ merged.select { |key, _value| key.split('/').length <= 2 }.each do |key, value|
128
+ next if value[:title].nil?
129
+ next if value[:hide_from_sidebar]
130
+
131
+ subgroups = merged.select { |subgroup_key, _subgroup_value| subgroup_key.include? key and subgroup_key != key and key != '/' }
132
+
133
+ active = active?(filename, key)
134
+ # puts "#{filename}, #{key}" if active
135
+ item_class = active ? 'nav-group active' : 'nav-group'
136
+
137
+ child = "<li class=\"#{item_class}\">"
138
+ child << "<div class=\"nav-group-heading\"><i class=\"material-icons\">arrow_right</i><span>#{value[:title].split('–').first}</span></div>"
139
+
140
+ child << '<ul class="nav-ul">'
141
+
142
+ subgroup = generateSubgroup(filename, key, value, subgroups, 2)
143
+
144
+ child << subgroup
145
+
146
+ if subgroups.any?
147
+ subgroups.select { |subgroup_key, _subgroup_value| subgroup_key.split('/').length <= 3 }.each do |subgroup_key, subgroup_value|
148
+ subgroup = generateSubgroup(filename, subgroup_key, subgroup_value, subgroups, 2)
149
+ child << subgroup
150
+ end
151
+ end
152
+
153
+ child << '</ul>'
154
+ child << '</li>'
155
+ sidebar << child
156
+ end
157
+
158
+ File.open('_site/sidebar.html', 'w') { |f| f.write(sidebar) }
159
+ sidebar
160
+ end
161
+
162
+ def active?(filename, url, exact = false)
163
+ if filename == '/' || url == '/'
164
+ if filename == '/' && url == '/'
165
+ return true
166
+ else
167
+ return false
168
+ end
169
+ end
170
+
171
+ exact ? filename == url : filename.start_with?(url)
172
+ end
173
+
174
+ def merge(hash1, hash2)
175
+ all_keys = hash1.keys | hash2.keys
176
+ result_hash = {}
177
+
178
+ all_keys.each do |key|
179
+ hash_value = {}
180
+
181
+ if hash1.key? key
182
+ value = hash1[key]
183
+
184
+ hash_value = value unless value.nil?
185
+ end
186
+
187
+ if hash2.key? key
188
+ value = hash2[key]
189
+
190
+ hash_value = hash_value.merge(value) unless value.nil?
191
+ end
192
+
193
+ result_hash[key] = hash_value
194
+ end
195
+
196
+ result_hash
197
+ end
198
+ end
199
+ end
200
+
201
+ sidebar = Jekyll::Sidebar.new
202
+
203
+ Jekyll::Hooks.register :site, :pre_render do |site, _payload|
204
+ site.pages.each do |page|
205
+ sidebar.pre_render page
206
+ end
207
+ end
208
+
209
+ Jekyll::Hooks.register :site, :post_write do |site|
210
+ sidebar.post_write site
211
+ end
@@ -0,0 +1,3 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'sidebar'
metadata CHANGED
@@ -1,37 +1,31 @@
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.6.1.pre.PullRequest0137.pre.0039
4
+ version: '1.8'
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-08-13 00:00:00.000000000 Z
11
+ date: 2020-09-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: jekyll
14
+ name: faraday
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '3.7'
20
- - - "<"
21
- - !ruby/object:Gem::Version
22
- version: '5.0'
19
+ version: 1.0.1
23
20
  type: :runtime
24
21
  prerelease: false
25
22
  version_requirements: !ruby/object:Gem::Requirement
26
23
  requirements:
27
24
  - - ">="
28
25
  - !ruby/object:Gem::Version
29
- version: '3.7'
30
- - - "<"
31
- - !ruby/object:Gem::Version
32
- version: '5.0'
26
+ version: 1.0.1
33
27
  - !ruby/object:Gem::Dependency
34
- name: jekyll-github-metadata
28
+ name: html-proofer
35
29
  requirement: !ruby/object:Gem::Requirement
36
30
  requirements:
37
31
  - - ">="
@@ -45,21 +39,27 @@ dependencies:
45
39
  - !ruby/object:Gem::Version
46
40
  version: '0'
47
41
  - !ruby/object:Gem::Dependency
48
- name: jekyll-material-icon-tag
42
+ name: jekyll
49
43
  requirement: !ruby/object:Gem::Requirement
50
44
  requirements:
51
45
  - - ">="
52
46
  - !ruby/object:Gem::Version
53
- version: '0'
47
+ version: '3.7'
48
+ - - "<"
49
+ - !ruby/object:Gem::Version
50
+ version: '5.0'
54
51
  type: :runtime
55
52
  prerelease: false
56
53
  version_requirements: !ruby/object:Gem::Requirement
57
54
  requirements:
58
55
  - - ">="
59
56
  - !ruby/object:Gem::Version
60
- version: '0'
57
+ version: '3.7'
58
+ - - "<"
59
+ - !ruby/object:Gem::Version
60
+ version: '5.0'
61
61
  - !ruby/object:Gem::Dependency
62
- name: jemoji
62
+ name: jekyll-contentblocks
63
63
  requirement: !ruby/object:Gem::Requirement
64
64
  requirements:
65
65
  - - ">="
@@ -73,7 +73,7 @@ dependencies:
73
73
  - !ruby/object:Gem::Version
74
74
  version: '0'
75
75
  - !ruby/object:Gem::Dependency
76
- name: sass
76
+ name: jekyll-github-metadata
77
77
  requirement: !ruby/object:Gem::Requirement
78
78
  requirements:
79
79
  - - ">="
@@ -87,21 +87,21 @@ dependencies:
87
87
  - !ruby/object:Gem::Version
88
88
  version: '0'
89
89
  - !ruby/object:Gem::Dependency
90
- name: faraday
90
+ name: jekyll-material-icon-tag
91
91
  requirement: !ruby/object:Gem::Requirement
92
92
  requirements:
93
93
  - - ">="
94
94
  - !ruby/object:Gem::Version
95
- version: 1.0.1
95
+ version: '0'
96
96
  type: :runtime
97
97
  prerelease: false
98
98
  version_requirements: !ruby/object:Gem::Requirement
99
99
  requirements:
100
100
  - - ">="
101
101
  - !ruby/object:Gem::Version
102
- version: 1.0.1
102
+ version: '0'
103
103
  - !ruby/object:Gem::Dependency
104
- name: html-proofer
104
+ name: jemoji
105
105
  requirement: !ruby/object:Gem::Requirement
106
106
  requirements:
107
107
  - - ">="
@@ -128,6 +128,20 @@ dependencies:
128
128
  - - ">="
129
129
  - !ruby/object:Gem::Version
130
130
  version: '0'
131
+ - !ruby/object:Gem::Dependency
132
+ name: nokogiri
133
+ requirement: !ruby/object:Gem::Requirement
134
+ requirements:
135
+ - - "~>"
136
+ - !ruby/object:Gem::Version
137
+ version: '1.10'
138
+ type: :runtime
139
+ prerelease: false
140
+ version_requirements: !ruby/object:Gem::Requirement
141
+ requirements:
142
+ - - "~>"
143
+ - !ruby/object:Gem::Version
144
+ version: '1.10'
131
145
  - !ruby/object:Gem::Dependency
132
146
  name: rake
133
147
  requirement: !ruby/object:Gem::Requirement
@@ -143,19 +157,19 @@ dependencies:
143
157
  - !ruby/object:Gem::Version
144
158
  version: '13.0'
145
159
  - !ruby/object:Gem::Dependency
146
- name: nokogiri
160
+ name: sass
147
161
  requirement: !ruby/object:Gem::Requirement
148
162
  requirements:
149
- - - "~>"
163
+ - - ">="
150
164
  - !ruby/object:Gem::Version
151
- version: '1.10'
165
+ version: '0'
152
166
  type: :runtime
153
167
  prerelease: false
154
168
  version_requirements: !ruby/object:Gem::Requirement
155
169
  requirements:
156
- - - "~>"
170
+ - - ">="
157
171
  - !ruby/object:Gem::Version
158
- version: '1.10'
172
+ version: '0'
159
173
  - !ruby/object:Gem::Dependency
160
174
  name: bundler
161
175
  requirement: !ruby/object:Gem::Requirement
@@ -189,7 +203,6 @@ files:
189
203
  - _includes/card-horizontal-list.html
190
204
  - _includes/card-list.html
191
205
  - _includes/card.html
192
- - _includes/front-page.html
193
206
  - _includes/google_analytics.html
194
207
  - _includes/img/merchants/logo-coop.svg
195
208
  - _includes/img/merchants/logo-elkjop.svg
@@ -214,6 +227,7 @@ files:
214
227
  - _includes/sidebar.html
215
228
  - _includes/toc.html
216
229
  - _layouts/default.html
230
+ - _layouts/front-page.html
217
231
  - _plugins/sidebar.rb
218
232
  - _sass/card.scss
219
233
  - _sass/code-view.scss
@@ -239,6 +253,9 @@ files:
239
253
  - assets/tipuesearch/tipuesearch.min.js
240
254
  - assets/tipuesearch/tipuesearch_content.js
241
255
  - assets/tipuesearch/tipuesearch_set.js
256
+ - lib/gem_version.rb
257
+ - lib/sidebar.rb
258
+ - lib/swedbank-pay-design-guide-jekyll-theme.rb
242
259
  homepage: https://github.com/SwedbankPay/swedbank-pay-design-guide-jekyll-theme
243
260
  licenses:
244
261
  - Apache-2.0
@@ -254,9 +271,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
254
271
  version: '0'
255
272
  required_rubygems_version: !ruby/object:Gem::Requirement
256
273
  requirements:
257
- - - ">"
274
+ - - ">="
258
275
  - !ruby/object:Gem::Version
259
- version: 1.3.1
276
+ version: '0'
260
277
  requirements: []
261
278
  rubygems_version: 3.1.2
262
279
  signing_key:
@@ -1,240 +0,0 @@
1
- {%- comment -%}
2
- **Parameters
3
- card_col_class: Grid column class the cards should be wrapped in
4
- num_dates: Amount of rows (based on dates in release_notes) should be displayed
5
- in release-notes
6
- {%- endcomment -%}
7
-
8
- {% assign card_col_class = include.card_col_class | default: "col-xxl-3 col-xl-6 col-lg-6" %}
9
- {% assign num_dates = include.num_dates | default: 3 %}
10
-
11
- <div class="front-page">
12
- <div class="front-page-container">
13
- <div class="front-page-top">
14
- <div class="front-page-hero">
15
- <h3>Welcome to the Swedbank Pay</h3>
16
- <div class="front-page-hero-name">
17
- {<span>developer portal</span>}
18
- </div>
19
- <p>
20
- Our developer portal gives you the full tool box for integrating
21
- our payment instruments and getting started with easy, flexible and
22
- safe payments on your e-commerce website.
23
- </p>
24
- </div>
25
- <div class="front-page-intro-cards">
26
- <h2 id="front-page-start" class="heading-line heading-line-white">Start your integration</h2>
27
- <div class="row mt-4">
28
- <div class="{{ card_col_class }}">
29
- {% include card.html title='Checkout'
30
- title_type="h2"
31
- text='With our Checkout you get the pre-built all-in-one
32
- payment solution, complete with a checkin interface and
33
- payment menu.'
34
- icon_content='shopping_cart'
35
- icon_outlined=true
36
- to='/checkout'
37
- %}
38
- </div>
39
- <div class="{{ card_col_class }}">
40
- {% include card.html title='Payments'
41
- title_type="h2"
42
- text='Payments gives you a one-by-one integration with more
43
- customization for each payment method to build your own
44
- payment menu.'
45
- icon_content='credit_card'
46
- to='/payments'
47
- %}
48
- </div>
49
- </div>
50
- </div>
51
- </div>
52
-
53
- <div class="front-page-merchants">
54
- <h6>Trusted by</h6>
55
- <div class="merchants-container justify-content-xxl-between">
56
- <a class="merchant-link">
57
- {% include img/merchants/logo-schibsted.svg %}
58
- </a>
59
- <a class="merchant-link">
60
- {% include img/merchants/logo-ica.svg %}
61
- </a>
62
- <a class="merchant-link">
63
- {% include img/merchants/logo-elkjop.svg %}
64
- </a>
65
- <a class="merchant-link">
66
- {% include img/merchants/logo-synsam.svg %}
67
- </a>
68
- <a class="merchant-link">
69
- {% include img/merchants/logo-coop.svg %}
70
- </a>
71
- <a class="merchant-link">
72
- {% include img/merchants/logo-svenskaspel.svg %}
73
- </a>
74
- <a class="merchant-link">
75
- {% include img/merchants/logo-skanetrafiken.svg %}
76
- </a>
77
- </div>
78
- </div>
79
- </div>
80
-
81
- <a href="https://ecom.externalintegration.payex.com/pspdemoshop" class="front-page-demoshop">
82
- <span class="front-page-demoshop-text">
83
- <span class="h2">Try our Demoshop<span>.</span></span>
84
- <span class="demoshop-text-description">
85
- Unsure about how it all works? See how our checkout and payment methods are used
86
- in practice!
87
- </span>
88
- </span>
89
- <span class="front-page-demoshop-link">
90
- <span class="h3">Go to the demoshop</span>
91
- <i class="material-icons">arrow_forward</i>
92
- <span class="demoshop-link-img">
93
- <img class="demoshop-link-img-mobile d-md-none d-lg-flex d-xl-none d-xxl-flex"
94
- src="/assets/img/demoshop-mobile.svg" alt="demoshop-mobile" />
95
- <img class="demoshop-link-img-mobile d-none d-md-none d-lg-flex d-xl-none"
96
- src="/assets/img/demoshop-mobile2.svg" alt="demoshop-mobile2" />
97
- <img class="demoshop-link-img-web d-none d-sm-none d-md-flex d-lg-none d-xl-flex"
98
- src="/assets/img/demoshop-web.svg" alt="demoshop-web" />
99
- </span>
100
- </span>
101
- </a>
102
-
103
- <div class="front-page-container">
104
- <div class="front-page-cards-sdk">
105
- <h2 id="front-page-sdk" class="heading-line heading-line-sdk">Looking for SDKs?</h2>
106
- <div class="row mt-4">
107
- <div class="{{ card_col_class }}">
108
- {% include card.html title='Android SDK'
109
- text='Learn more about how to integrate our Android SDK'
110
- icon_content='img/sdks/logo-android.svg'
111
- icon_svg=true
112
- type='sdk'
113
- to=''
114
- %}
115
- </div>
116
- <div class="{{ card_col_class }}">
117
- {% include card.html title='Swift SDK'
118
- text='Learn more about how to integrate our Swift SDK'
119
- icon_content='img/sdks/logo-swift.svg'
120
- icon_svg=true
121
- type='sdk'
122
- to=''
123
- %}
124
- </div>
125
- <div class="{{ card_col_class }}">
126
- {% include card.html title='.NET SDK'
127
- text='Learn more about how to integrate our .NET SDK'
128
- icon_content='img/sdks/logo-net.svg'
129
- icon_svg=true
130
- type='sdk'
131
- to=''
132
- %}
133
- </div>
134
- <div class="{{ card_col_class }}">
135
- {% include card.html title='PHP SDK'
136
- text='Learn more about how to integrate our PHP SDK'
137
- icon_content='img/sdks/logo-php.svg'
138
- icon_svg=true
139
- type='sdk'
140
- to=''
141
- %}
142
- </div>
143
- </div>
144
- </div>
145
-
146
- <div class="front-page-cards-module">
147
- <h2 id="front-page-module" class="heading-line heading-line-module">Or perhaps modules?</h2>
148
- <div class="row mt-4">
149
- <div class="{{ card_col_class }}">
150
- {% include card.html title='Episerver'
151
- text='See how you can integrate the Episerver module'
152
- icon_content='img/modules/logo-episerver.svg'
153
- icon_svg=true
154
- type='module'
155
- to=''
156
- %}
157
- </div>
158
- <div class="{{ card_col_class }}">
159
- {% include card.html title='Magento 2'
160
- text='See how you can integrate the Magento 2 module'
161
- icon_content='img/modules/logo-magento2.svg'
162
- icon_svg=true
163
- type='module'
164
- to=''
165
- %}
166
- </div>
167
- <div class="{{ card_col_class }}">
168
- {% include card.html title='WooCommerce'
169
- text='See how you can integrate the WooCommerce module'
170
- icon_content='img/modules/logo-woocommerce.svg'
171
- icon_svg=true
172
- type='module'
173
- to=''
174
- %}
175
- </div>
176
- </div>
177
- </div>
178
-
179
- <div class="front-page-release-notes">
180
- <h2 id="front-page-release-notes" class="heading-line heading-line-green">What's new in the documentation
181
- </h2>
182
- {% include release_notes.html num_dates=num_dates %}
183
- <a href="/resources/release-notes">See full release notes</a>
184
- </div>
185
-
186
- <div class="front-page-cards-extra">
187
- <h2 id="front-page-extra-resources" class="heading-line">Extra resources</h2>
188
- <div class="row mt-4">
189
- <div class="{{ card_col_class }}">
190
- {% include card.html title='OS development guidelines'
191
- text='This is how we create an inclusive environment'
192
- icon_content='account_circle'
193
- icon_outlined=true
194
- to=''
195
- %}
196
- </div>
197
- <div class="{{ card_col_class }}">
198
- {% include card.html title='Test data'
199
- text='Get the required data for testing in our interfaces'
200
- icon_content='content_paste'
201
- to=''
202
- %}
203
- </div>
204
- <div class="{{ card_col_class }}">
205
- {% include card.html title='Terminology'
206
- text='Get a better understanding of the terms we use'
207
- icon_content='menu_book'
208
- to=''
209
- %}
210
- </div>
211
- <div class="{{ card_col_class }}">
212
- {% include card.html title='See all resources (7)'
213
- text='Data protection, public migration key etc'
214
- no_icon=true
215
- to=''
216
- %}
217
- </div>
218
- </div>
219
- </div>
220
-
221
- <div class="front-page-contact">
222
- <div class="front-page-contact-content">
223
- <div class="row">
224
- <div class="col-xl-7">
225
- <h2 id="front-page-contact" class="heading-line heading-line-long">Can't find what you are
226
- looking for?</h2>
227
- <p>
228
- We are always trying to make the developer portal as
229
- good as it can be please don’t hesitate to contact us.
230
- </p>
231
- </div>
232
- <div class="col-xl-5 d-flex align-items-center justify-content-center">
233
- <button class="btn">Contact us here</button>
234
- </div>
235
- </div>
236
- </div>
237
- </div>
238
-
239
- </div>
240
- </div>