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

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: 7d576204f0905f4ad97a12cbbf4a5bef4b2efed40fd24728f315ef29aa1bdee2
4
- data.tar.gz: 76f4c8c9d616c993a50db2b83ef1d186d422222199f5063ec6273c0e247531ce
3
+ metadata.gz: 03e53f1ddfdcd3aae0eaabdca94653a4a5ede896ac5f30bc9e53bf4d4af4de01
4
+ data.tar.gz: 36eb1abeb83df816c73a05363b8f7dcafcdf3fcd4ccddcd82cd46fd72160e79e
5
5
  SHA512:
6
- metadata.gz: 9a1b3b671e7effeb8b76fc0d501a9bed6b4ddf9a918c88fe2f50e23ddb539f901d7905bef61784d86141b8f4e2bc434391a480dd7274ebc1256188618f1b28ba
7
- data.tar.gz: '09e20f7c41ac0c68eca729641ede6287ec05e9c1f101dd62d3ba33e4f2e523b9eda1f2527170c1f590b297a96ab4d057af44e0f8b3d44cd5fe35339a20e1670d'
6
+ metadata.gz: b02bb2c3b906bc02570d12b355f518ffb0ffce035246d767f0114948089f511b6fb2ea7b11fee24869fcc513ee292acdb94804ee7a8dc5c7ba63cf9a0a439ac2
7
+ data.tar.gz: 8db66ae7900d2ccfa6dfa1a34bce1b0336a5bcbe41dd948ba49f229fce8485ee0028645bbc7db04498b73aef6a59d1e9cb219994aeabe08fad327234b7f11fe0
@@ -0,0 +1,11 @@
1
+ {% assign content = include.content | markdownify%}
2
+
3
+ <div class="accordion accordion-table mb-4">
4
+ <button type="button" class="accordion-header pt-0" aria-expanded="false" aria-controls="exp-1">
5
+ <span class="mr-3 show">Show properties</span>
6
+ <span class="mr-3 hide">Hide properties</span>
7
+ </button>
8
+ <div class="accordion-body p-0" id="exp-1">
9
+ {{ content }}
10
+ </div>
11
+ </div>
@@ -10,7 +10,7 @@
10
10
  {%- capture device_height_string -%}
11
11
  (device-height: {{ device_height }})
12
12
  {%- endcapture -%}
13
- {%- if device_orientation != nil && device_orientation != empty -%}
13
+ {%- if device_orientation != nil and device_orientation != empty -%}
14
14
  {%- capture device_orientation_string -%}
15
15
  (orientation: {{ device_orientation }}) and
16
16
  {%- endcapture -%}
@@ -0,0 +1,11 @@
1
+ {% assign github_branch = site.github.branch | default : "develop" %}
2
+
3
+ <a href="{{ site.github.repository_url }}/tree/{{ github_branch }}/{{ page.path }}"
4
+ class="github" target="_blank"
5
+ rel="noopener noreferrer" title="Edit '{{ page.title }}' on GitHub">
6
+ <svg aria-labelledby="simpleicons-github-icon" role="img" width="50" viewBox="0 0 24 24"
7
+ xmlns="http://www.w3.org/2000/svg">
8
+ <title id="simpleicons-github-icon">Edit "{{ page.title }}" on GitHub</title>
9
+ <path fill="#fff" d="M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12" />
10
+ </svg>
11
+ </a>
@@ -5,13 +5,13 @@
5
5
 
6
6
  <nav class="iterator d-flex">
7
7
  {% if prev_href != blank and prev_href != empty and prev_href != nil %}
8
- <a class="mr-auto btn btn-guiding" role="button" rel="prev" href="{{ prev_href }}">
8
+ <a class="mr-auto btn btn-primary" role="button" rel="prev" href="{{ prev_href }}">
9
9
  {{ prev_title }}
10
10
  </a>
11
11
  {% endif %}
12
12
 
13
13
  {% if next_href != blank and next_href != empty and next_href != nil %}
14
- <a class="ml-auto btn btn-executive" role="button" rel="next" href="{{ next_href }}">
14
+ <a class="ml-auto btn btn-primary" role="button" rel="next" href="{{ next_href }}">
15
15
  {{ next_title }}
16
16
  </a>
17
17
  {% endif %}
@@ -1,24 +1,25 @@
1
1
  {% assign num_dates = include.num_dates %}
2
- {% assign pages = site.pages %}
3
- {% for node in pages %}
4
- {% if node.url contains '/resources/release-notes' %}
2
+ {% for page in site.pages %}
3
+ {% assign release_notes_url = '/resources/release-notes' %}
4
+ {% if page.url contains release_notes_url %}
5
5
  <div class="release-notes-container">
6
- {% assign dates = node.content | markdownify | split: '<h2' | | slice: 1, num_dates %}
7
- {% assign variable = value %}
6
+ {% assign dates = page.content | markdownify | split: '<h2' | slice: 1, num_dates %}
8
7
 
9
8
  {% for date in dates %}
10
9
  <div class="row">
11
10
  {% assign versions = date | split: '<h3' %}
11
+ {% assign date_id = date | regex_capture: 'id="([^"]+)"' | first %}
12
12
  <div class="col-md-2 release-notes-date">
13
- {% assign date_value = versions[0] | remove: '</h2>' | | split: '>' %}
14
- {{ date_value[1] }}
13
+ {% assign date_value = versions[0] | remove: '</h2>' | split: '>' %}
14
+ <a href="{{ release_notes_url }}#{{ date_id }}">{{ date_value[1] | strip }}</a>
15
15
  </div>
16
16
  {% assign version_list = versions | shift %}
17
17
  <div class="col-md-10">
18
18
  {% for version in version_list %}
19
- {% assign version_parts = version | | split: '</h3>' %}
19
+ {% assign version_parts = version | split: '</h3>' %}
20
20
  {% assign version_value = version_parts[0] | split: '>' %}
21
- <p class="h4">{{ version_value[1] }}</p>
21
+ {% assign version_id = version | regex_capture: 'id="([^"]+)"' | first %}
22
+ <p class="h4"><a href="{{ release_notes_url }}#{{ version_id }}">{{ version_value[1] }}</a></p>
22
23
  {{ version_parts[1] }}
23
24
  {% endfor %}
24
25
  </div>
@@ -26,4 +27,4 @@
26
27
  {% endfor %}
27
28
  </div>
28
29
  {% endif %}
29
- {% endfor %}
30
+ {% endfor %}
@@ -29,4 +29,6 @@
29
29
  <p>{{ description | markdownify }}</p>
30
30
  {% endif %}
31
31
  </div>
32
+
33
+ {% include github.html %}
32
34
  </div>
@@ -1,31 +1,30 @@
1
- {%- assign title = page.title | default: "PayEx Design Guide theme for Jekyll" -%}
1
+ {%- assign lead_title = page.lead_title -%}
2
+ {%- if lead_title == nil and page.sidebar.navigation == nil -%}
3
+ {%- unless page.name contains "index" -%}
4
+ {%- assign dirname = page.dir | split: "/" | last | remove: "/" | capitalize -%}
5
+ {%- unless dirname == "" -%}
6
+ {%- assign lead_title = dirname -%}
7
+ {%- endunless -%}
8
+ {%- endunless -%}
9
+ {%- endif -%}
10
+ {%- assign main_title = page.main_title | default: page.title | default: "PayEx Design Guide theme for Jekyll" -%}
11
+ {%- capture title -%}{%- if lead_title != nil -%}{{ lead_title }} – {% endif %}{{ main_title }}{%- endcapture -%}
2
12
  {%- assign description = page.opengraph.description | default: site.opengraph.description -%}
3
13
  {%- assign image = page.opengraph.image | default: site.opengraph.image -%}
4
- {%- assign github_branch = site.github.branch | default : "develop" -%}
5
14
  {%- assign design_guide_base_url = site.design_guide.base_url | default: 'https://design.swedbankpay.com' -%}
6
- {%- assign design_guide_version = site.design_guide.version | default: '4.7.0' -%}
15
+ {%- assign design_guide_version = site.design_guide.version | default: '4.8.1' -%}
7
16
  {%- assign design_guide_url = design_guide_base_url | append: '/v/' | append: design_guide_version -%}
8
- {%- if page.sidebar.navigation == nil -%}
9
- {%- unless page.name contains "index" -%}
10
- {%- assign dirname = page.dir | split: "/" | last | remove: "/" | capitalize -%}
11
- {%- unless dirname == "" -%}
12
- {%- assign title = dirname | append: " – " | append: title -%}
13
- {%- endunless -%}
14
- {%- endunless -%}
15
- {%- endif -%}
16
17
  <!DOCTYPE html>
17
18
  <html lang="{{ site.lang | default: "en-US" }}">
18
-
19
19
  <head>
20
20
  <meta charset="utf-8" />
21
21
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
22
22
  <meta name="mobile-web-app-capable" content="yes">
23
23
  <meta name="theme-color" content="#000">
24
- <meta name="application-name" content="{{ page.title }}">
24
+ <meta name="application-name" content="{{ title }}">
25
25
  <meta name="apple-mobile-web-app-capable" content="yes">
26
26
  <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
27
- <meta name="apple-mobile-web-app-title"
28
- content="{{ page.title | default: 'PayEx Design Guide theme for Jekyll' }}">
27
+ <meta name="apple-mobile-web-app-title" content="{{ title }}">
29
28
  <meta name="msapplication-TileColor" content="#000">
30
29
  <meta name="msapplication-TileImage" content="{{ design_guide_version_url }}/icons/mstile-144x144.png">
31
30
  <meta property="og:type" value="website" />
@@ -66,12 +65,26 @@
66
65
  <nav class="sidebar-nav">
67
66
  <a href="/" class="sidebar-header">
68
67
  <img src="{{ design_guide_url }}/img/swedbankpay-logo-v.svg"
69
- alt="Swedbank Pay vertical logo" />
68
+ alt="Swedbank Pay vertical logo" class="logotype-vertical logotype-lg"/>
70
69
  <div class="sidebar-header-text">
71
70
  <span>{</span>developer portal<span>}</span>
72
71
  </div>
73
72
  </a>
74
-
73
+ {% if site.search.enabled == true %}
74
+ <form class="search-container mx-2 my-4 px-3 py-2 d-flex"
75
+ method="get" action="{{ site.search.url | relative_url }}">
76
+ <input name="q" type="text" id="tipue_search_input"
77
+ class="search-input w-100 "
78
+ placeholder="Search in documentation"
79
+ onfocus="this.placeholder=''"
80
+ onblur="this.placeholder='Search in documentation'"
81
+ pattern=".{3,}"
82
+ title="At least 3 characters">
83
+ <label for="search-input" class="mb-0">
84
+ <i class="material-icons m-0" aria-hidden="true">search</i>
85
+ </label>
86
+ </form>
87
+ {% endif %}
75
88
  <ul id="dx-sidebar-main-nav-ul" class="main-nav-ul">
76
89
  </ul>
77
90
  </nav>
@@ -93,12 +106,7 @@
93
106
  </main>
94
107
  </div>
95
108
  </div>
96
-
97
- <footer class="page-footer">
98
- <p class="page-footer-rights">© Swedbank Pay</p>
99
- </footer>
100
109
  </div>
101
-
102
110
  <script src="{{ design_guide_url }}/scripts/dg.js"></script>
103
111
  <script src="{{ '/assets/js/swedbank-pay-design-guide-theme.js' | relative_url }}"></script>
104
112
  {%- if site.google_analytics.tracking_id %}
@@ -21,6 +21,8 @@ layout: default
21
21
  <h2 id="front-page-start" class="heading-line heading-line-white">{{ front_page_start_heading }}</h2>
22
22
  {% contentblock start %}
23
23
  </div>
24
+
25
+ {% include github.html %}
24
26
  </div>
25
27
  <div class="front-page-container">
26
28
  {% if show_merchants_bar == true %}
@@ -52,7 +54,7 @@ layout: default
52
54
  </div>
53
55
  </div>
54
56
  {% endif %}
55
- <a href="https://ecom.externalintegration.payex.com/pspdemoshop" class="front-page-demoshop">
57
+ <div class="front-page-demoshop">
56
58
  <span class="front-page-demoshop-text">
57
59
  <span class="h2">Try our Demoshop</span>
58
60
  <span class="demoshop-text-description">
@@ -61,8 +63,11 @@ layout: default
61
63
  </span>
62
64
  </span>
63
65
  <span class="front-page-demoshop-link">
64
- <span class="h3">Go to the demoshop</span>
65
- <i class="material-icons">arrow_forward</i>
66
+ <a href="https://ecom.externalintegration.payex.com/pspdemoshop" class="text-decoration-none">
67
+ <span class="h3 mr-2">Go to the demoshop
68
+ <i class="material-icons ml-2">arrow_forward</i>
69
+ </span>
70
+ </a>
66
71
  <span class="demoshop-link-img">
67
72
  <img class="demoshop-link-img-mobile d-none d-md-flex"
68
73
  src="/assets/img/demoshop-mobile.svg" alt="demoshop-mobile" />
@@ -72,7 +77,7 @@ layout: default
72
77
  src="/assets/img/demoshop-web.svg" alt="demoshop-web" />
73
78
  </span>
74
79
  </span>
75
- </a>
80
+ </div>
76
81
 
77
82
  <div class="front-page-container">
78
83
  <div class="front-page-cards-sdk">
@@ -0,0 +1,5 @@
1
+ ---
2
+ layout: default
3
+ ---
4
+
5
+ <div id="tipue_search_content"></div>
@@ -0,0 +1,3 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative '../lib/swedbank-pay-design-guide-jekyll-theme'
@@ -0,0 +1,96 @@
1
+ @import 'colors.scss';
2
+
3
+ .accordion {
4
+ align-items: center;
5
+
6
+ &.accordion-table {
7
+ border: none;
8
+
9
+ .show {
10
+ display: block;
11
+ }
12
+
13
+ .hide {
14
+ display: none;
15
+ }
16
+
17
+ &.accordion-open {
18
+ border: none;
19
+
20
+ .show {
21
+ display: none;
22
+ }
23
+
24
+ .hide {
25
+ display: block;
26
+ }
27
+ }
28
+
29
+ .accordion-header {
30
+ &:before {
31
+ bottom: 1rem;
32
+ margin: auto;
33
+ transition: .3s;
34
+ color: $brown;
35
+ }
36
+
37
+ span {
38
+ font-weight: normal;
39
+ }
40
+ &:hover {
41
+ span {
42
+ font-weight: bold;
43
+ }
44
+ }
45
+ }
46
+
47
+ .accordion-body {
48
+ @media (min-width: 1250px) {
49
+ width: 70vw;
50
+ max-width: 80rem;
51
+ }
52
+ }
53
+
54
+ table {
55
+ border: 1px solid rgba(153, 153, 153, 0.5);
56
+ border-radius: 0.25rem;
57
+
58
+ th {
59
+ font-size: 0.875rem;
60
+ }
61
+
62
+ tbody {
63
+ font-size: 0.875rem;
64
+
65
+ tr:nth-child(odd) {
66
+ background-color: #F9F8F6;
67
+ }
68
+
69
+ tr {
70
+ td:not(:last-child) {
71
+ font-family: $mono;
72
+
73
+ code {
74
+ border: none;
75
+ background-color: transparent;
76
+ padding: 0;
77
+ }
78
+ }
79
+
80
+ td:not(:last-child):not(:nth-last-child(2)) {
81
+ code {
82
+ font-weight: 700;
83
+ }
84
+ }
85
+ }
86
+
87
+ tr {
88
+ &:hover {
89
+ background-color: $apricot;
90
+ transition: .5s;
91
+ }
92
+ }
93
+ }
94
+ }
95
+ }
96
+ }
@@ -83,6 +83,10 @@ $front-page-max-width: 1312px;
83
83
  color: $white;
84
84
  font-size: 1.125rem;
85
85
  }
86
+
87
+ a {
88
+ color: #43d0dd;
89
+ }
86
90
 
87
91
  .front-page-hero-name {
88
92
  font-family: $mono;
@@ -113,11 +117,10 @@ $front-page-max-width: 1312px;
113
117
  }
114
118
 
115
119
  @media screen and (min-width: $breakpoint-xxl) {
116
- margin-bottom: 9rem;
120
+ margin-bottom: 10rem;
117
121
 
118
122
  .front-page-intro-cards {
119
123
  position: absolute;
120
- bottom: -7rem;
121
124
  left: 0;
122
125
  width: 100%;
123
126
  padding: 0 4rem;
@@ -235,19 +238,6 @@ $front-page-max-width: 1312px;
235
238
  text-decoration: none;
236
239
  border-radius: 1rem;
237
240
 
238
- &:hover,
239
- &:focus {
240
- .front-page-demoshop-link {
241
- background-color: $white;
242
- color: $brown;
243
-
244
- .h3 {
245
- color: $brown;
246
- }
247
-
248
- }
249
- }
250
-
251
241
  &:after {
252
242
  display: none;
253
243
  content: none;
@@ -299,6 +289,21 @@ $front-page-max-width: 1312px;
299
289
  box-shadow: 1px 2px 10px rgba(0, 0, 0, 0.15);
300
290
  max-width: $front-page-max-width;
301
291
  width: 100%;
292
+ cursor: pointer;
293
+
294
+ a::after{
295
+ content: '';
296
+ }
297
+
298
+ &:hover,
299
+ &:focus {
300
+ background-color: $white;
301
+ color: $brown;
302
+
303
+ .h3 {
304
+ color: $brown;
305
+ }
306
+ }
302
307
 
303
308
  .demoshop-link-img {
304
309
  display: flex;
@@ -306,6 +311,7 @@ $front-page-max-width: 1312px;
306
311
  position: absolute;
307
312
  bottom: -1rem;
308
313
  right: 3%;
314
+ pointer-events: none;
309
315
 
310
316
  .demoshop-link-img-web {
311
317
  width: 26.5rem;
@@ -6,14 +6,13 @@
6
6
  display: flex;
7
7
  flex-direction: column;
8
8
  align-items: center;
9
- margin-bottom: 2.5rem;
10
9
  margin-top: 2rem;
11
10
  text-decoration: none;
12
11
  color: #512b2b;
13
12
 
14
13
  img {
15
- width: 120px;
16
- margin-top: -1rem;
14
+ margin-top: 1.5rem;
15
+ margin-bottom: 1.25rem;
17
16
  }
18
17
 
19
18
  span {
@@ -30,6 +29,37 @@
30
29
  }
31
30
  }
32
31
 
32
+ .search-container {
33
+ box-shadow: 1px 2px 10px rgba(0, 0, 0, 0.15);
34
+ border-radius: 0.125rem;
35
+
36
+ &:focus-within {
37
+ outline: -webkit-focus-ring-color auto 0.5px;
38
+ }
39
+
40
+ .search-input {
41
+ color: $medium-brown;
42
+ font-size: 0.875rem;
43
+ border: none;
44
+ padding: 0.375rem;
45
+
46
+ &:focus {
47
+ color: $brown;
48
+ outline: none
49
+ }
50
+ }
51
+
52
+ i {
53
+ display: block;
54
+ color: $brown;
55
+
56
+ &:hover {
57
+ color: $turquoise-link;
58
+ }
59
+ }
60
+
61
+ }
62
+
33
63
  .main-nav-ul {
34
64
  .nav-group {
35
65
  .nav-ul {
@@ -7,6 +7,7 @@
7
7
  @import 'code-view.scss';
8
8
  @import 'front-page.scss';
9
9
  @import 'heading.scss';
10
+ @import 'accordion-table.scss';
10
11
  @import 'paragraph-highlight.scss';
11
12
  @import 'sidebar.scss';
12
13
  @import 'title-header.scss';
@@ -23,7 +24,6 @@ body {
23
24
  }
24
25
 
25
26
  .table {
26
-
27
27
  th,
28
28
  td {
29
29
  >.material-icons {
@@ -292,4 +292,20 @@ a[href ^='https://']:not([href *='{{ site.url }}']):after {
292
292
  font-size: 1rem !important;
293
293
  }
294
294
  }
295
+
296
+ .github {
297
+ opacity: .5;
298
+ position: absolute;
299
+ right: 4rem;
300
+ top: 4rem;
301
+ transition: opacity .3s;
302
+ }
303
+
304
+ a.github:after {
305
+ display: none;
306
+ }
307
+
308
+ a.github:hover {
309
+ opacity: 1;
310
+ }
295
311
  }
@@ -32,6 +32,9 @@
32
32
  margin-right: 0.5rem;
33
33
  }
34
34
  }
35
+ a {
36
+ color: #43d0dd;
37
+ }
35
38
  }
36
39
 
37
40
 
@@ -36,7 +36,7 @@
36
36
  .highlight .nf { color: #00aa00 } /* Name.Function */
37
37
  .highlight .nn { color: #00aaaa; text-decoration: underline } /* Name.Namespace */
38
38
  .highlight .nt { color: #1e90ff; font-weight: bold } /* Name.Tag */
39
- .highlight .nv { color: #aa0000 } /* Name.Variable */
39
+ .highlight .nv { color: #e07088 } /* Name.Variable */
40
40
  .highlight .ow { color: #0000aa } /* Operator.Word */
41
41
  .highlight .w { color: #bbbbbb } /* Text.Whitespace */
42
42
  .highlight .mb { color: #009999 } /* Literal.Number.Bin */
@@ -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.7'
8
8
  end
9
9
  end
10
10
  end
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'liquid'
4
+
5
+ # Jekyll
6
+ module Jekyll
7
+ # Adds a 'regex_capture' filter to Liquid. Performs a regular expression match
8
+ # on the provided string and returns the capture as an array. Example usage:
9
+ # {{ html | regex_capture: 'id="([^"]+)"' | first }}
10
+ module RegexCaptureFilter
11
+ def regex_capture(str, regex)
12
+ match = /#{regex}/.match(str)
13
+ match ? match.captures : []
14
+ end
15
+ end
16
+ end
17
+
18
+ Liquid::Template.register_filter(Jekyll::RegexCaptureFilter)
@@ -1,4 +1,4 @@
1
- # frozen_string_literal: false
1
+ # frozen_string_literal: true
2
2
 
3
3
  require 'jekyll'
4
4
  require 'nokogiri'
@@ -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
@@ -1,4 +1,4 @@
1
- # frozen_string_literal: false
1
+ # frozen_string_literal: true
2
2
 
3
3
  require 'jekyll'
4
4
  require 'nokogiri'
@@ -56,6 +56,11 @@ module SwedbankPay
56
56
  end
57
57
 
58
58
  def hidden_for?(other_page)
59
+ if @jekyll_page.data['layout'] == 'search'
60
+ # Never show the search result page in the menu.
61
+ return true
62
+ end
63
+
59
64
  # The current page should be hidden for the other page unless the
60
65
  # other page is also hidden.
61
66
  hidden = hidden?
@@ -1,4 +1,4 @@
1
- # frozen_string_literal: false
1
+ # frozen_string_literal: true
2
2
 
3
3
  require 'forwardable'
4
4
 
@@ -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|
@@ -1,3 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require_relative 'sidebar'
4
+ require_relative 'regex_capture_filter'
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.7
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-12-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -207,6 +207,7 @@ extra_rdoc_files: []
207
207
  files:
208
208
  - LICENSE
209
209
  - README.md
210
+ - _includes/accordion-table.html
210
211
  - _includes/alert.html
211
212
  - _includes/anchor_headings.html
212
213
  - _includes/apple-mobile-headers.html
@@ -217,6 +218,7 @@ files:
217
218
  - _includes/card-horizontal-list.html
218
219
  - _includes/card-list.html
219
220
  - _includes/card.html
221
+ - _includes/github.html
220
222
  - _includes/google_analytics.html
221
223
  - _includes/img/merchants/logo-coop.svg
222
224
  - _includes/img/merchants/logo-elkjop.svg
@@ -243,7 +245,9 @@ files:
243
245
  - _includes/toc.html
244
246
  - _layouts/default.html
245
247
  - _layouts/front-page.html
246
- - _plugins/sidebar.rb
248
+ - _layouts/search.html
249
+ - _plugins/swedbank-pay-design-guide-jekyll-theme.rb
250
+ - _sass/accordion-table.scss
247
251
  - _sass/breakpoints.scss
248
252
  - _sass/card.scss
249
253
  - _sass/code-view.scss
@@ -270,6 +274,7 @@ files:
270
274
  - assets/tipuesearch/tipuesearch_content.js
271
275
  - assets/tipuesearch/tipuesearch_set.js
272
276
  - lib/gem_version.rb
277
+ - lib/regex_capture_filter.rb
273
278
  - lib/safe_merge.rb
274
279
  - lib/sanitized_filename.rb
275
280
  - lib/sidebar.rb
@@ -1,3 +0,0 @@
1
- # frozen_string_literal: false
2
-
3
- require_relative '../lib/sidebar'