swedbank-pay-design-guide-jekyll-theme 1.10.1 → 1.12.0

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: 19ee08d9790dff4e1cb23a6a83e6fd3dc4aacc4ce3e525512e48c44e308f410a
4
- data.tar.gz: 7f4aba83c60b9e3479309b0dd4ded8a4d2252fdd1a353513ef945159b66ab49d
3
+ metadata.gz: 1a429e2ccf36382e968c44364a71d52610a2f42fabf5b8cad7b0495b6895a773
4
+ data.tar.gz: 15228d84db373ff8806365334af8290a7b861eab7d44bb52fcb0c1bf5b45ae9b
5
5
  SHA512:
6
- metadata.gz: 794b358433885c1c8f814fa28ba0b740c0198ae79028e51efd7ea231b6f030361a8096636be0e7ce30e36e3b4fff2ceaa030af0bbe52ee67a46a75c6ed6cc8a2
7
- data.tar.gz: 3c58bb6a40ba660b993356b9e182e7d67f833458bd9f78b00fe20f015210f5c69b8d78e15bf29affe548616a5b1604908d1f01dd12f03f6b1c78eb6363b33af2
6
+ metadata.gz: 32fd558a5ce72bb1c80e589802ac0d96db5631989994a36c30f97ad5699ecc4a18ed75b606fd4fcaca12f2413587ac6e7e80d1b419b68d5a3553d8f0206b2bca
7
+ data.tar.gz: 7c6312c808c0b1e8e342b64ea37438decd64cecab72445501e1cbcddf75b9cc47d92f6440142c950d662f7e1961578ed6dc5072ebce2f181ee2b18ef845caa38
data/README.md CHANGED
@@ -5,7 +5,7 @@
5
5
  ![Test status][test-badge]
6
6
  ![Deploy status][deploy-badge]
7
7
  [![License][license-badge]][license]
8
- [![Dependabot Status][dependabot-badge]][dependabot]
8
+ [![Codacy][codacy-badge]][codacy]
9
9
  [![CLA assistant][cla-badge]][cla]
10
10
  [![Contributor Covenant][coc-badge]][coc]
11
11
 
@@ -84,8 +84,8 @@ agreement][cla].
84
84
  [clone]: <https://help.github.com/articles/cloning-a-repository/>
85
85
  [coc-badge]: <https://img.shields.io/badge/Contributor%20Covenant-v2.0%20adopted-ff69b4.svg>
86
86
  [coc]: <./CODE_OF_CONDUCT.md>
87
- [dependabot-badge]: <https://api.dependabot.com/badges/status?host=github&repo=SwedbankPay/swedbank-pay-design-guide-jekyll-theme>
88
- [dependabot]: <https://dependabot.com>
87
+ [codacy-badge]: <https://app.codacy.com/project/badge/Grade/30ebfb7d531a488484e87dd428034af7>
88
+ [codacy]: <https://www.codacy.com/gh/SwedbankPay/swedbank-pay-design-guide-jekyll-theme/dashboard?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=SwedbankPay/swedbank-pay-design-guide-jekyll-theme&amp;utm_campaign=Badge_Grade>
89
89
  [deploy-badge]: <https://github.com/SwedbankPay/swedbank-pay-design-guide-jekyll-theme/workflows/Deploy/badge.svg>
90
90
  [design-guide]: <https://design.swedbankpay.com/>
91
91
  [developer-portal]: <https://developer.swedbankpay.com/>
@@ -96,7 +96,6 @@ agreement][cla].
96
96
  [license]: <https://opensource.org/licenses/MIT>
97
97
  [liquid]: <https://jekyllrb.com/docs/liquid/>
98
98
  [opengraph-image]: <https://repository-images.githubusercontent.com/209270355/36818080-53ee-11ea-896c-082addb851a6>
99
- [repo]: <https://github.com/SwedbankPay/swedbank-pay-design-guide-jekyll-theme/>
100
99
  [ruby]: <https://www.ruby-lang.org/en/>
101
100
  [swedbankpay]: <https://swedbankpay.github.io/swedbank-pay-design-guide-jekyll-theme/>
102
101
  [test-badge]: <https://github.com/SwedbankPay/swedbank-pay-design-guide-jekyll-theme/workflows/Test/badge.svg>
@@ -7,19 +7,23 @@ type: sdk | module - Empty type result in default card styling
7
7
  col_class(required): Describes what grid column class(es) each card should be wrapped in
8
8
  {%- endcomment -%}
9
9
 
10
+ {% assign cards = include.card_list | default: page.children %}
11
+ {% assign col_class = include.col_class | default: 'col-lg-4' %}
12
+
10
13
  <div class="row card-list">
11
- {% for card in include.card_list %}
14
+ {% for card in cards %}
12
15
  {% assign title = card.title | split: '–' | last %}
13
- {% assign link_to = card.extensionless_path | default: card.url %}
16
+ {% assign link_to = card.absolute_path | default: card.url %}
17
+
14
18
  {% assign card_type = card.card.type | default: card.card_type | default: include.type %}
15
19
  {% assign icon_content = card.card.icon.content | default: card.icon.content %}
16
20
  {% assign icon_outlined = card.card.icon.outlined | default: card.icon.outlined %}
17
21
  {% assign icon_svg = card.card.icon.svg | default: card.icon.svg %}
18
22
  {% assign no_icon = card.card.icon.no_icon | default: card.icon.no_icon %}
19
23
  {% assign horizontal = card.card.horizontal | default: false %}
20
- {% assign disabled = card.card.disabled | default: false %}
24
+ {% assign disabled = card.card.disabled | default: card.disabled %}
21
25
 
22
- <div class="{{ include.col_class }}">
26
+ <div class="{{ col_class }}">
23
27
  {% include card.html
24
28
  title=title
25
29
  text=card.description
@@ -1,8 +1,9 @@
1
1
  {% for child in page.children %}
2
2
  {% if child.children && child.children.size > 0 %}
3
+ {% assign title = child.title | default: child.section %}
3
4
  {% capture header %}
4
5
  {:.heading-line}
5
- ## {{ child.title }}
6
+ ## {{ title }}
6
7
  {% endcapture %}
7
8
  {% assign header = header | markdownify %}
8
9
  {% include anchor_headings.html html=header anchorClass='header-anchor' %}
data/_includes/card.html CHANGED
@@ -60,7 +60,7 @@ type: sdk | module - Empty type result in default card styling
60
60
  </span>
61
61
  <span class="dx-card-content">
62
62
  <span class="{{ title_type }}">{{ include.title }}</span>
63
- <span>{{ text }}</span>
63
+ <span>{{ text | markdownify }}</span>
64
64
  </span>
65
65
  {% unless disabled %}
66
66
  <i class="material-icons">arrow_forward</i>
@@ -0,0 +1,433 @@
1
+ ''
2
+ '' swedbankpay theme based on https://design.swedbankpay.com
3
+ ''
4
+ '' Author = "Asbjørn Ulsberg"
5
+ '' Copyright (c) 2021 Swedbank Pay
6
+
7
+ !$theme = "swedbankpay"
8
+
9
+ !$black = "#222222"
10
+ !$text_gray = "#767676"
11
+ !$list_gray = "#999999"
12
+ !$light_gray = "#f9f8f6"
13
+ !$white = "#ffffff"
14
+ !$solid_brown = "#2f2424"
15
+ !$dark_brown = "#493c3b"
16
+ !$medium_brown = "#72605e"
17
+ !$soft_brown = "#a38b80"
18
+ !$light_brown = "#d4c4bc"
19
+ !$orange = "#f35b1c"
20
+ !$light_orange = "#f5b895"
21
+ !$peach = "#fbf2ea"
22
+ !$cyan = "#257886"
23
+ !$light_cyan = "#ebf8f2"
24
+
25
+ !$brand_primary = "#fdc129"
26
+ !$brand_primary_light = "#ffcc00"
27
+ !$brand_primary_light_2 = "#ffdf88"
28
+ !$brand_primary_light_3 = "#fff3d5"
29
+ !$brand_secondary_dark_1 = $dark_brown
30
+ !$brand_secondary_dark_2 = $solid_brown
31
+ !$brand_secondary = "#512b2b"
32
+ !$brand_secondary_light_1 = $medium_brown
33
+ !$brand_secondary_light_2 = $soft_brown
34
+ !$brand_secondary_light_3 = $light_brown
35
+ !$brand_secondary_light_4 = "#d4b8a3"
36
+ !$brand_secondary_info_1 = "#8acdc3"
37
+ !$brand_secondary_info_2 = "#efb7b6"
38
+ !$brand_tertiary = "#ee7023"
39
+ !$brand_accent = "#31a3ae"
40
+ !$brand_accent_links = $cyan
41
+ !$brand_accent_disabled = "#98d0d6"
42
+
43
+ ' Background Colors
44
+ !$brand_bg_1 = $peach
45
+ !$brand_bg_2 = $light_cyan
46
+ !$brand_bg_3 = "#fbedf4"
47
+ !$brand_bg_4 = "#e9f7fb"
48
+ !$brand_bg_gray = "#ebe7e2"
49
+ !$brand_bg_white = "#ffffff"
50
+
51
+ ' State colors
52
+ !$brand_success = "#437e15"
53
+ !$brand_success_light = "#f2f7eb"
54
+ !$brand_success_light_2 = "#99cc66"
55
+ !$brand_warning = "#f9ce22"
56
+ !$brand_warning_light = "#fff3d5"
57
+ !$brand_warning_2 = $brand_tertiary
58
+ !$brand_error_border = "#f1bbb9"
59
+ !$brand_error = "#c5131c"
60
+ !$brand_error_light = "#f9ded3"
61
+ !$brand_info = "#3e6ab6"
62
+ !$brand_info_light = "#e8eff9"
63
+
64
+ !$primary_text = $solid_brown
65
+ !$secondary_text = $black
66
+ !$info_text = $black
67
+ !$success_text = $white
68
+ !$warning_text = $white
69
+ !$danger_text = $white
70
+
71
+ !procedure $code($msg)
72
+ <font:Consolas>$msg</font>
73
+ !endprocedure
74
+
75
+ !procedure $participant($sprite, $title)
76
+ participant "<$$sprite,color=$light_orange>\n\n$title"
77
+ !endprocedure
78
+
79
+ !procedure $primary_scheme()
80
+ FontColor $primary_text
81
+ BorderColor $light_orange
82
+ BackgroundColor $peach
83
+ !endprocedure
84
+
85
+ sprite $payer [75x79/4z] {
86
+ xT85bWCn30JHxjBzpxmCyeGC2gV2CF-PT9uC4NpT0Y82088WVmpu_Zc8tp-3cbXAAJyW5NT2lQWNzQ9U5FT0EGVO1d17BRM5-NsrJjPUV126GSfiO4zJj1Ha
87
+ TOW2-m2bCSeWaygNqrL2YoXm4MNGbj8S1LgcudTwErHCKSOg6XMeW299BUKbIakKazHUeq7AIbHkGraIM2Vgf0mw5UwYGCDKxAN07HIxdurRog0PoZBA0MY2
88
+ 4eWTokh8UCVQfQIfONcNKb-xez-XB4qEIxYCaYOfGnMbGied_Wkg6fO7B4uDgtArAADycyE2ilFW6pscLdTmYvJW5YdZAafGHXbNKO92obMKu1OfuofAK40L
89
+ z0u
90
+ }
91
+
92
+ sprite $merchant [75x62/4z] {
93
+ xPG7TiCm3CM8h_kVEJkXPPggdjZT8c-PYE4j-nZG6eHI64u1aaAfS3MxRLk6SieHoVNLKrAx_feYxKegf9XoSEP4cY8J2YBEgQLQc2-auXuj4yobbCwdK_4A
94
+ MKYrOq5oYFaB98pZ3jycnLIAGqCzrRB_Es8k9GvJuaLkK9QgyqpXzVugPbLoLjWBJQjq74HG117dcEJZNj6fuzFjPZmCKgOKLJXVjcKwPMFbI8Xj6dnZh48A
95
+ M-KdfHXz5ueCKqWHxYdsBAIqbD8efPw_aVfF_QTQCSKLUu0LKcQ0EQmlCcQIXYcGD7LM7J657fHJ21uH6p6HyeAki9wIUzrPJ-6b1-KKUa8r9USRfEujU3k5
96
+ Y9DD2abrdcdgN3jd
97
+ }
98
+
99
+ sprite $server [75x98/4z] {
100
+ xPS5hkH050FjyltFl3JGcWo_UALF9GXNcgsMH0D9CXqiWHg0X5K16xLKud2IELoe4kOa5ohs4A-sSjZ7AXMqLNAkZYDLJcqcwNJjdcfQmVZgE53rUj2zSQLz
101
+ gelHxlm3ai3X40wd0AUhq_MwI18lrJ_PdF-oo5WDZ0HsmuGaEXoC3LJb8qOg7pHIrOzKCeMF6gdghgAF8pNZIFMfekluGIBrIlaIkOfKiccY37BmeqMgsf6g
102
+ F0Bo4FLpiAcY6AbOtWlTI2s5gkhuPvVwgaeLl5JE56zKP7VlgR45uA1IGPLhrLQOiSgR8r86gglyMyUHwbgPcOeGheu3LQq7QOmheztnx8k9Op85QwaAT5NT
103
+ LHJi3nQfBm6em1TI_QX-L3yg3lHCqAgTmGNJfBsuYH_j4uggUWLVTvLCgsPgkQmEhtb-0m
104
+ }
105
+
106
+ sprite $3rdparty [75x67/4z] {
107
+ xPO7biCW34JvtF_EszS3cIU7bqbFj7LawGSBKTg20RHpMF-pcCOlHgo8n8PCISEBajLf4j6WcC0aA1jZ-7xdHt7MKPslLYJDW86ZRj3_wLgsnWzO0686hCrQ
108
+ RfndkyhBv3rnVwYJQzuNBIV9LcOBPlj9T1yh-uhZAG8pb9mdT6Cld1nV8-xqj2xdwlL0pedkJg-9LU77LpZhSGsxd3cdD3fwMABeZ17IuakBwU_trmnJ5dyl
109
+ Ve3gXif7TVvQvJDu_hxAk_tyQ_3yEyFvzwlz3TETyc6V6vXDU61MZ79sBDgIwn8YhUPUaZuRXjeZ4w7Q6nMKFM-66YMDzQH9p_ORiFJmV5-oDJxyA8q9HHUI
110
+ PjdqhW9Cvm9-JEYlIJQV7WgfF_AxLBI4KXKiSfCSuZR9XDBdADZaZ690SNHKCueQjL0h5cjrnXayNr-ThzkbxLHSbih-1
111
+ }
112
+
113
+ ''
114
+ '' Global Default Values
115
+ ''
116
+ skinparam backgroundColor "transparent"
117
+ skinparam useBetaStyle false
118
+ skinparam creoleMonospacedFont "Consolas"
119
+ skinparam defaultMonospacedFontName "Consolas"
120
+ skinparam defaultFontName "Arial"
121
+ skinparam defaultFontSize 16
122
+ skinparam dpi 100
123
+ skinparam shadowing false
124
+ skinparam roundcorner 20
125
+ skinparam ParticipantPadding 40
126
+ skinparam BoxPadding 40
127
+ skinparam Padding 8
128
+ skinparam ArrowColor $orange
129
+ skinparam stereotype {
130
+ CBackgroundColor $brand_secondary_light_1
131
+ CBorderColor $orange
132
+ ABackgroundColor $brand_success_light
133
+ ABorderColor $brand_success
134
+ IBackgroundColor $brand_error_light
135
+ IBorderColor $brand_error
136
+ EBackgroundColor $brand_warning_light
137
+ EBorderColor $brand_warning
138
+ NBackgroundColor $brand_info_light
139
+ NBorderColor $brand_info
140
+ }
141
+ skinparam title {
142
+ FontColor $primary_text
143
+ BorderColor $orange
144
+ FontSize 20
145
+ BorderRoundCorner 8
146
+ BorderThickness 1
147
+ BackgroundColor $peach
148
+ }
149
+
150
+ skinparam legend {
151
+ BackgroundColor $brand_secondary
152
+ BorderColor $brand_secondary_dark_1
153
+ FontColor $primary_text
154
+ }
155
+
156
+ !startsub swimlane
157
+ skinparam swimlane {
158
+ BorderColor $brand_info
159
+ BorderThickness 2
160
+ TitleBackgroundColor $brand_secondary
161
+ TitleFontColor $primary_text
162
+ }
163
+ !endsub
164
+
165
+ !startsub activity
166
+
167
+ skinparam activity {
168
+ $primary_scheme()
169
+ BarColor $brand_success
170
+ StartColor $brand_info
171
+ EndColor $brand_info
172
+ ''
173
+ DiamondBackgroundColor $brand_secondary_light_1
174
+ DiamondBorderColor $brand_secondary_dark_1
175
+ DiamondFontColor $primary_text
176
+ }
177
+ !endsub
178
+
179
+ !startsub participant
180
+ skinparam participant {
181
+ $primary_scheme()
182
+ BorderThickness 0
183
+ BackgroundColor $white
184
+
185
+ ParticipantBorderThickness 2
186
+ }
187
+ !endsub
188
+
189
+ !startsub actor
190
+ skinparam actor {
191
+ $primary_scheme()
192
+ BackgroundColor $peach
193
+ BorderColor $orange
194
+ }
195
+ !endsub
196
+
197
+ !startsub arrow
198
+ skinparam arrow {
199
+ Thickness 1
200
+ Color $orange
201
+ FontColor $primary_text
202
+ }
203
+ !endsub
204
+
205
+ !startsub sequence
206
+ skinparam sequence {
207
+ BorderColor $orange
208
+ ' For some reason sequence title font color does not pick up from global
209
+ TitleFontColor $primary_text
210
+ BackgroundColor $peach
211
+ StartColor $orange
212
+ EndColor $orange
213
+ ''
214
+ BoxBackgroundColor $brand_bg_1
215
+ BoxBorderColor $brand_secondary_dark_1
216
+ BoxFontColor $primary_text
217
+ ''
218
+ DelayFontColor $primary_text
219
+ ''
220
+ LifeLineBorderColor $orange
221
+ LifeLineBorderThickness 1
222
+ LifeLineBorderRoundCorner 20
223
+ LifeLineBackgroundColor $white
224
+ ''
225
+ GroupBorderThickness 1
226
+ GroupBorderColor $orange
227
+ GroupFontColor $primary_text
228
+ GroupHeaderFontColor $primary_text
229
+ GroupHeaderFontWeight 1
230
+ GroupBackgroundColor $white
231
+ GroupBodyBackgroundColor $peach
232
+ GroupHeaderBackgroundColor $brand_primary_light_2
233
+ ''
234
+ DividerBackgroundColor $brand_secondary_dark_1
235
+ DividerBorderColor $brand_secondary_dark_1
236
+ DividerBorderThickness 2
237
+ DividerFontColor $primary_text
238
+ ''
239
+ ReferenceBackgroundColor $brand_primary_light_2
240
+ ReferenceBorderColor $brand_secondary_dark_1
241
+ ReferenceFontColor $primary_text
242
+ ReferenceHeaderFontColor $primary_text
243
+ ReferenceHeaderBackgroundColor $brand_secondary
244
+ ''
245
+ StereotypeFontColor $primary_text
246
+ }
247
+ !endsub
248
+
249
+ !startsub partition
250
+
251
+ skinparam partition {
252
+ BorderColor $brand_primary
253
+ FontColor $primary_text
254
+ BackgroundColor $brand_primary_light_2
255
+ }
256
+ !endsub
257
+
258
+ !startsub collections
259
+ skinparam collections {
260
+ $primary_scheme()
261
+ }
262
+ !endsub
263
+
264
+ !startsub control
265
+ skinparam control {
266
+ $primary_scheme()
267
+ }
268
+ !endsub
269
+
270
+ !startsub entity
271
+
272
+ skinparam entity {
273
+ $primary_scheme()
274
+ }
275
+ !endsub
276
+
277
+ !startsub boundary
278
+ skinparam boundary {
279
+ $primary_scheme()
280
+ }
281
+ !endsub
282
+
283
+ !startsub agent
284
+ skinparam agent {
285
+ BackgroundColor $brand_warning
286
+ BorderColor $brand_warning_light
287
+ FontColor $primary_text
288
+ }
289
+ !endsub
290
+
291
+ !startsub note
292
+ skinparam note {
293
+ BorderThickness 1
294
+ BackgroundColor $brand_bg_2
295
+ BorderColor $cyan
296
+ }
297
+ !endsub
298
+
299
+ !startsub artifact
300
+
301
+ skinparam artifact {
302
+ BackgroundColor $brand_secondary_dark_1
303
+ BorderColor $brand_secondary_dark_2
304
+ FontColor $primary_text
305
+ }
306
+ !endsub
307
+
308
+ !startsub component
309
+ skinparam component {
310
+ $primary_scheme()
311
+ }
312
+ !endsub
313
+
314
+ !startsub interface
315
+ skinparam interface {
316
+ BackgroundColor $brand_error
317
+ BorderColor $brand_error
318
+ FontColor $primary_text
319
+ }
320
+ !endsub
321
+
322
+ !startsub storage
323
+ skinparam storage {
324
+ $primary_scheme()
325
+ }
326
+ !endsub
327
+
328
+ !startsub node
329
+ skinparam node {
330
+ $primary_scheme()
331
+ }
332
+ !endsub
333
+
334
+ !startsub cloud
335
+ skinparam cloud {
336
+ $primary_scheme()
337
+ }
338
+ !endsub
339
+
340
+ !startsub database
341
+ skinparam database {
342
+ $primary_scheme()
343
+ }
344
+ !endsub
345
+
346
+ !startsub class
347
+ skinparam class {
348
+ $primary_scheme()
349
+ HeaderBackgroundColor $brand_primary_light
350
+ StereotypeFontColor $primary_text
351
+ BorderThickness 1
352
+ AttributeFontColor $primary_text
353
+ AttributeFontSize 11
354
+ }
355
+ !endsub
356
+
357
+ !startsub object
358
+ skinparam object {
359
+ $primary_scheme()
360
+ StereotypeFontColor $primary_text
361
+ BorderThickness 1
362
+ AttributeFontColor $primary_text
363
+ AttributeFontSize 11
364
+ }
365
+ !endsub
366
+
367
+ !startsub usecase
368
+ skinparam usecase {
369
+ $primary_scheme()
370
+ BorderThickness 2
371
+ StereotypeFontColor $primary_text
372
+ }
373
+ !endsub
374
+
375
+ !startsub rectangle
376
+ skinparam rectangle {
377
+ $primary_scheme()
378
+ StereotypeFontColor $primary_text
379
+ }
380
+ !endsub
381
+
382
+ !startsub package
383
+ skinparam package {
384
+ $primary_scheme()
385
+ }
386
+ !endsub
387
+
388
+ !startsub folder
389
+ skinparam folder {
390
+ $primary_scheme()
391
+ }
392
+ !endsub
393
+
394
+ !startsub frame
395
+ skinparam frame {
396
+ $primary_scheme()
397
+ }
398
+ !endsub
399
+
400
+ !startsub state
401
+ skinparam state {
402
+ $primary_scheme()
403
+ StartColor $orange
404
+ EndColor $brand_secondary
405
+ AttributeFontColor $primary_text
406
+ AttributeFontSize 11
407
+ }
408
+ !endsub
409
+
410
+ !startsub queue
411
+ skinparam queue {
412
+ $primary_scheme()
413
+ }
414
+ !endsub
415
+
416
+ !startsub card
417
+ skinparam card {
418
+ $primary_scheme()
419
+ }
420
+ !endsub
421
+
422
+ !startsub file
423
+ skinparam file {
424
+ $primary_scheme()
425
+ }
426
+ !endsub
427
+
428
+ !startsub stack
429
+
430
+ skinparam stack {
431
+ $primary_scheme()
432
+ }
433
+ !endsub
data/lib/gem_version.rb CHANGED
@@ -4,7 +4,7 @@ module Gem
4
4
  # Gem Specification
5
5
  class Specification
6
6
  def self.gem_version
7
- '1.10.1'
7
+ '1.12.0'
8
8
  end
9
9
  end
10
10
  end
data/lib/sidebar.rb CHANGED
@@ -3,6 +3,7 @@
3
3
  require 'jekyll'
4
4
  require 'nokogiri'
5
5
  require 'json'
6
+ require_relative 'sidebar_logger'
6
7
  require_relative 'sidebar_page'
7
8
  require_relative 'sidebar_parser'
8
9
  require_relative 'sidebar_renderer'
@@ -15,16 +16,16 @@ module SwedbankPay
15
16
  attr_reader :pages
16
17
 
17
18
  def pre_render(site)
18
- Jekyll.logger.debug(' Sidebar: pre_render')
19
+ SidebarLogger.debug('pre_render')
19
20
  @parser = SidebarParser.new(site)
20
21
  @pages = SidebarTreeBuilder.new(@parser.pages)
21
- Jekyll.logger.debug(" Sidebar: #{@pages.inspect}")
22
+ SidebarLogger.debug(@pages.inspect)
22
23
  end
23
24
 
24
25
  def post_write
25
26
  @sidebar_renderer = SidebarRenderer.new(@pages)
26
27
  @parser.parse(@pages)
27
- Jekyll.logger.debug(' Sidebar: post_write')
28
+ SidebarLogger.debug('post_write')
28
29
  @sidebar_renderer.render
29
30
  end
30
31
  end
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: false
2
2
 
3
+ require_relative 'sidebar_logger'
3
4
  require_relative 'sidebar_page'
4
5
 
5
6
  module SwedbankPay
@@ -27,10 +28,10 @@ module SwedbankPay
27
28
  current_page_name = current_page.respond_to?(:name) ? current_page.name : current_page.to_s
28
29
 
29
30
  if page.hidden_for?(current_page)
30
- Jekyll.logger.debug(" Sidebar: #{page.name} is hidden for #{current_page_name}")
31
+ SidebarLogger.debug("#{page.name} is hidden for #{current_page_name}")
31
32
  next
32
33
  elsif page.hidden?
33
- Jekyll.logger.debug(" Sidebar: Hidden page #{page.name} is not hidden for #{current_page_name}")
34
+ SidebarLogger.debug("Hidden page #{page.name} is not hidden for #{current_page_name}")
34
35
  end
35
36
 
36
37
  sub_items_markup = sub_items_markup(page, current_page)
@@ -0,0 +1,32 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'jekyll'
4
+
5
+ module SwedbankPay
6
+ # Logs stuff
7
+ module SidebarLogger
8
+ class << self
9
+ def debug(message)
10
+ Jekyll.logger.debug prefix(message)
11
+ end
12
+
13
+ def info(message)
14
+ Jekyll.logger.info prefix(message)
15
+ end
16
+
17
+ def warn(message)
18
+ Jekyll.logger.warn prefix(message)
19
+ end
20
+
21
+ def error(message)
22
+ Jekyll.logger.error prefix(message)
23
+ end
24
+
25
+ private
26
+
27
+ def prefix(message)
28
+ " Sidebar: #{message}"
29
+ end
30
+ end
31
+ end
32
+ end
data/lib/sidebar_page.rb CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  require 'jekyll'
4
4
  require 'nokogiri'
5
+ require_relative 'sidebar_logger'
5
6
  require_relative 'sidebar_path'
6
7
  require_relative 'sidebar_page_title'
7
8
  require_relative 'sidebar_page_collection'
@@ -31,6 +32,7 @@ module SwedbankPay
31
32
  @order = menu_order(jekyll_page)
32
33
  @children = SidebarPageCollection.new(self)
33
34
  @card_overview = jekyll_page['card_overview'].nil? ? false : jekyll_page['card_overview']
35
+ @anchor_headings = jekyll_page['anchor_headings'].nil? ? true : jekyll_page['anchor_headings']
34
36
  end
35
37
 
36
38
  def active?(current, is_leaf: false)
@@ -67,7 +69,7 @@ module SwedbankPay
67
69
  hidden = hidden?
68
70
 
69
71
  if other_page.nil? || !other_page.is_a?(SidebarPage)
70
- Jekyll.logger.debug(" Sidebar: Other page '#{other_page}' is nil or not a SidebarPage")
72
+ SidebarLogger.debug("Other page '#{other_page}' is nil or not a SidebarPage")
71
73
  return hidden
72
74
  end
73
75
 
@@ -106,19 +108,20 @@ module SwedbankPay
106
108
 
107
109
  def enrich_jekyll
108
110
  if @title.nil?
109
- Jekyll.logger.debug(" Sidebar: No title for #{@name}")
111
+ SidebarLogger.debug("No title for #{@name}")
110
112
  return
111
113
  end
112
114
 
113
- Jekyll.logger.debug(" Sidebar: <#{@path}>.lead_title('#{@title.lead}').main_title('#{@title.main}')")
115
+ SidebarLogger.debug("<#{@path}>.lead_title('#{@title.lead}').main_title('#{@title.main}')")
114
116
 
115
117
  @jekyll_page.data['lead_title'] = @title.lead
116
118
  @jekyll_page.data['main_title'] = @title.main
117
119
  @jekyll_page.data['children'] = @children
120
+ @jekyll_page.data['absolute_path'] = @path
118
121
  end
119
122
 
120
123
  def save
121
- Jekyll.logger.debug(" Writing Sidebar: #{filename}")
124
+ SidebarLogger.debug(" Writing Sidebar: #{filename}")
122
125
 
123
126
  File.open(@filename, 'w') do |file|
124
127
  html = @doc.to_html(encoding: 'UTF-8')
@@ -154,6 +157,10 @@ module SwedbankPay
154
157
  @card_overview
155
158
  end
156
159
 
160
+ def anchor_headings?
161
+ @anchor_headings
162
+ end
163
+
157
164
  private
158
165
 
159
166
  def menu_order(jekyll_page)
@@ -173,14 +180,14 @@ module SwedbankPay
173
180
 
174
181
  def find_path(current)
175
182
  if current.nil?
176
- Jekyll.logger.warn(' Sidebar: Nil current_page')
183
+ SidebarLogger.warn('Nil current_page')
177
184
  return ''
178
185
  end
179
186
 
180
187
  return current if current.is_a? String
181
188
  return current.path if current.respond_to?(:path)
182
189
 
183
- Jekyll.logger.warn(" Sidebar: #{current.class} ('#{current}') does not respond to :path.")
190
+ SidebarLogger.warn("#{current.class} ('#{current}') does not respond to :path.")
184
191
 
185
192
  ''
186
193
  end
@@ -2,6 +2,7 @@
2
2
 
3
3
  require 'jekyll'
4
4
  require 'jekyll-redirect-from'
5
+ require_relative 'sidebar_logger'
5
6
  require_relative 'sidebar_path'
6
7
 
7
8
  module SwedbankPay
@@ -30,7 +31,7 @@ module SwedbankPay
30
31
 
31
32
  pages.each do |jekyll_page|
32
33
  if skippable? jekyll_page
33
- Jekyll.logger.debug(" Sidebar: Skipping <#{jekyll_page['url']}>")
34
+ SidebarLogger.debug("Skipping <#{jekyll_page['url']}>")
34
35
  next
35
36
  end
36
37
 
@@ -60,7 +61,7 @@ module SwedbankPay
60
61
  headers = []
61
62
 
62
63
  # Don't include headers in the sidebar if we're on a card overview page.
63
- return headers if page.card_overview?
64
+ return headers if page.card_overview? || !page.anchor_headings?
64
65
 
65
66
  page.doc.xpath('//h2').each do |header|
66
67
  id = header['id']
@@ -81,7 +82,7 @@ module SwedbankPay
81
82
  sidebar_containers = page.doc.xpath('//*[@id="dx-sidebar-main-nav-ul"]')
82
83
 
83
84
  if sidebar_containers.empty?
84
- Jekyll.logger.error(" Sidebar: No sidebar container found in <#{page.filename}>!")
85
+ SidebarLogger.error("No sidebar container found in <#{page.filename}>!")
85
86
  return nil
86
87
  end
87
88
 
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require_relative 'sidebar_logger'
3
4
  require_relative 'sidebar_html_builder'
4
5
 
5
6
  module SwedbankPay
@@ -31,12 +32,12 @@ module SwedbankPay
31
32
  name = page.filename || page.name || page.to_s
32
33
 
33
34
  if sidebar_html.nil?
34
- Jekyll.logger.warn(" Sidebar: No HTML rendered for #{name}.")
35
+ SidebarLogger.warn("No HTML rendered for #{name}.")
35
36
  next
36
37
  end
37
38
 
38
39
  if page.sidebar_container.nil?
39
- Jekyll.logger.warn(" Sidebar: No sidebar container found in '#{name}'. #{page.filename}")
40
+ SidebarLogger.warn("No sidebar container found in '#{name}'. #{page.filename}")
40
41
  next
41
42
  end
42
43
 
@@ -57,8 +58,8 @@ module SwedbankPay
57
58
  File.open('_site/sidebar.html', 'w') { |f| f.write(sidebar_html) }
58
59
  rescue StandardError => e
59
60
  name = page.filename || page.name || page.to_s
60
- Jekyll.logger.error(" Sidebar: Unable to render sidebar for '#{name}'.")
61
- Jekyll.logger.debug(" Sidebar: #{e.message}. #{e.backtrace.inspect}")
61
+ SidebarLogger.error("Unable to render sidebar for '#{name}'.")
62
+ SidebarLogger.debug("#{e.message}. #{e.backtrace.inspect}")
62
63
  end
63
64
 
64
65
  sidebar_html
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.10.1
4
+ version: 1.12.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Swedbank Pay
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-03-24 00:00:00.000000000 Z
11
+ date: 2021-08-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -258,6 +258,7 @@ files:
258
258
  - assets/img/external-url.svg
259
259
  - assets/js/mermaid.min.js
260
260
  - assets/js/swedbank-pay-design-guide-theme.js
261
+ - assets/puml-theme-swedbankpay.puml
261
262
  - assets/tipuesearch/search.png
262
263
  - assets/tipuesearch/tipuesearch.min.js
263
264
  - assets/tipuesearch/tipuesearch_content.js
@@ -268,6 +269,7 @@ files:
268
269
  - lib/sanitized_filename.rb
269
270
  - lib/sidebar.rb
270
271
  - lib/sidebar_html_builder.rb
272
+ - lib/sidebar_logger.rb
271
273
  - lib/sidebar_page.rb
272
274
  - lib/sidebar_page_collection.rb
273
275
  - lib/sidebar_page_title.rb
@@ -289,14 +291,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
289
291
  requirements:
290
292
  - - ">="
291
293
  - !ruby/object:Gem::Version
292
- version: 2.4.0
294
+ version: 2.5.0
293
295
  required_rubygems_version: !ruby/object:Gem::Requirement
294
296
  requirements:
295
297
  - - ">="
296
298
  - !ruby/object:Gem::Version
297
299
  version: '0'
298
300
  requirements: []
299
- rubygems_version: 3.1.4
301
+ rubygems_version: 3.1.6
300
302
  signing_key:
301
303
  specification_version: 4
302
304
  summary: Swedbank Pay Design Guide theme for Jekyll