swedbank-pay-design-guide-jekyll-theme 1.9.13 → 1.10.0

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: 0db373509896bff58b9852ee23afd1c67aa33d45de2806b87e550c722177faad
4
- data.tar.gz: 2c41abc2d75542c41aded98c9f0f607ee28a7073da1e6ab86d02921fae43b3f5
3
+ metadata.gz: 9d75a81c46fdd8b54db9bdedbd6f2ab116f3c5b39da55fe1e394b1194a44ecff
4
+ data.tar.gz: a5f07b043e51424f139e61eb40aac49f227a26dfd9b3976e634882836d2bd2d2
5
5
  SHA512:
6
- metadata.gz: 18d8e433d154888df87f90096d597a462c0dd050742f855bbb357624cc78a3aeec9dd216267c250651df8808954231a9b654f940b36d4c3f30d5fd68eaa59eb5
7
- data.tar.gz: 1b8c3e5ad467092780934d0bcf5270d1465eb28ec9a810c90a3519751e1665fb7e9f7ac888ecdd0de4c577850aed24ed51bda790c97941054b5132d797d19282
6
+ metadata.gz: eb181bd3f5a33e421344f7dfa84991551dd3897a10f0cb3dbaaede72007ac4008d347d925e6b38290f8451e770bb59ffb1c8a2cf74210357118f2a9ce52755ee
7
+ data.tar.gz: d96ffc9da54916d3dbdc9cf8319e0091ccedcd37a6ab7488b4adecccfe2fc1423cde1b8a86a0d62fc95654b7afc1d03106eeacbd529319d7f55b7a74226f7207
@@ -7,22 +7,25 @@ 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 card_list = include.card_list %}
11
- {% assign type = include.type %}
12
- {% assign col_class = include.col_class %}
13
-
14
10
  <div class="row card-list">
15
- {% for card in card_list %}
11
+ {% for card in include.card_list %}
16
12
  {% assign title = card.title | split: '–' | last %}
17
- <div class="{{ col_class }}">
18
- {% include card.html title=title
13
+ {% assign link_to = card.extensionless_path | default: card.url %}
14
+ {% assign card_type = card.card_type | default: include.type %}
15
+ {% assign icon_content = card.card.icon.content | default: card.icon.content %}
16
+ {% assign icon_outlined = card.card.icon.outlined | default: card.icon.outlined %}
17
+ {% assign icon_svg = card.card.icon.svg | default: card.icon.svg %}
18
+
19
+ <div class="{{ include.col_class }}">
20
+ {% include card.html
21
+ title=title
19
22
  text=card.description
20
- icon_content=card.icon.content
21
- icon_outlined=card.icon.outlined
22
- icon_svg=card.icon.svg
23
- to=card.url
24
- type=type
23
+ icon_content=icon_content
24
+ icon_outlined=icon_outlined
25
+ icon_svg=icon_svg
26
+ to=link_to
27
+ type=card_type
25
28
  %}
26
29
  </div>
27
30
  {% endfor %}
28
- </div>
31
+ </div>
@@ -0,0 +1,12 @@
1
+ {% for child in page.children %}
2
+ {% if child.children && child.children.size > 0 %}
3
+ {% capture header %}
4
+ {:.heading-line}
5
+ ## {{ child.title }}
6
+ {% endcapture %}
7
+ {% assign header = header | markdownify %}
8
+ {% include anchor_headings.html html=header anchorClass='header-anchor' %}
9
+ {% assign col_class = child.card.col_class | default: 'col-lg-4' %}
10
+ {% include card-list.html card_list=child.children col_class=col_class %}
11
+ {% endif %}
12
+ {% endfor %}
@@ -0,0 +1,19 @@
1
+ {% capture max_width_class %}
2
+ {% if page.layout == 'front-page' %}
3
+ no-padding
4
+ {% elsif page.card_overview %}
5
+ normal-padding max-width-card-overview
6
+ {% else %}
7
+ normal-padding max-width
8
+ {% endif %}
9
+ {% endcapture %}
10
+
11
+ <div class="doc-container {{ max_width_class | strip }}">
12
+ <article>
13
+ {% if page.card_overview %}
14
+ {% include card-overview.html %}
15
+ {% else %}
16
+ {% include anchor_headings.html html=content anchorClass='header-anchor' %}
17
+ {% endif %}
18
+ </article>
19
+ </div>
@@ -95,14 +95,7 @@
95
95
  {% if page.layout != 'front-page' %}
96
96
  {% include title-header.html %}
97
97
  {% endif %}
98
- <div class="doc-container{% if page.layout == 'front-page' %} no-padding
99
- {% elsif page.card_overview %} normal-padding max-width-card-overview
100
- {% else %} normal-padding max-width
101
- {% endif %}">
102
- <article>
103
- {% include anchor_headings.html html=content anchorClass='header-anchor' %}
104
- </article>
105
- </div>
98
+ {% include doc-container.html %}
106
99
  </main>
107
100
  </div>
108
101
  </div>
@@ -110,7 +103,7 @@
110
103
  <script src="{{ design_guide_url }}/scripts/dg.js"></script>
111
104
  <script src="{{ '/assets/js/swedbank-pay-design-guide-theme.js' | relative_url }}"></script>
112
105
  {%- if site.google_analytics.tracking_id %}
113
- {% include google_analytics.html %}
106
+ {% include google_analytics.html %}
114
107
  {%- endif %}
115
108
  </body>
116
109
 
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.9.13'
7
+ '1.10.0'
8
8
  end
9
9
  end
10
10
  end
@@ -100,9 +100,9 @@ module SwedbankPay
100
100
  return leaf_markup(page.path, main_title, page.level) unless page.headers?
101
101
 
102
102
  # If there's no children, only return the headers as leaf node items.
103
- return page.headers.map { |h| header_markup(page, h) }.join('') unless page.children?
103
+ return page.headers.map { |h| header_markup(page, h) }.join unless page.children?
104
104
 
105
- headers_markup = page.headers.map { |h| header_markup(page, h) }.join('')
105
+ headers_markup = page.headers.map { |h| header_markup(page, h) }.join
106
106
  headers_markup = "<ul class=\"nav-ul\">#{headers_markup}</ul>"
107
107
 
108
108
  item_markup(page, current_page, headers_markup, true)
data/lib/sidebar_page.rb CHANGED
@@ -30,6 +30,7 @@ module SwedbankPay
30
30
  @title = SidebarPageTitle.parse(jekyll_page, self)
31
31
  @order = menu_order(jekyll_page)
32
32
  @children = SidebarPageCollection.new(self)
33
+ @card_overview = jekyll_page['card_overview'].nil? ? false : jekyll_page['card_overview']
33
34
  end
34
35
 
35
36
  def active?(current, is_leaf: false)
@@ -113,6 +114,7 @@ module SwedbankPay
113
114
 
114
115
  @jekyll_page.data['lead_title'] = @title.lead
115
116
  @jekyll_page.data['main_title'] = @title.main
117
+ @jekyll_page.data['children'] = @children
116
118
  end
117
119
 
118
120
  def save
@@ -144,6 +146,14 @@ module SwedbankPay
144
146
  @doc
145
147
  end
146
148
 
149
+ def to_liquid
150
+ @jekyll_page.to_liquid
151
+ end
152
+
153
+ def card_overview?
154
+ @card_overview
155
+ end
156
+
147
157
  private
148
158
 
149
159
  def menu_order(jekyll_page)
@@ -32,5 +32,9 @@ module SwedbankPay
32
32
 
33
33
  count
34
34
  end
35
+
36
+ def to_liquid
37
+ @pages
38
+ end
35
39
  end
36
40
  end
@@ -59,16 +59,19 @@ module SwedbankPay
59
59
  def find_headers(page)
60
60
  headers = []
61
61
 
62
+ # Don't include headers in the sidebar if we're on a card overview page.
63
+ return headers if page.card_overview?
64
+
62
65
  page.doc.xpath('//h2').each do |header|
63
- next unless header['id']
66
+ id = header['id']
67
+
68
+ next unless id
64
69
 
65
70
  child_markup = header.last_element_child
66
- header = {
67
- id: header['id'],
68
- title: header.content.strip,
69
- hash: (child_markup['href']).to_s
70
- }
71
- headers.push(header)
71
+ hash = child_markup['href'].to_s if child_markup.respond_to? :[]
72
+ title = header.content.strip
73
+
74
+ headers.push({ id: id, title: title, hash: hash })
72
75
  end
73
76
 
74
77
  headers
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.13
4
+ version: 1.10.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-01 00:00:00.000000000 Z
11
+ date: 2021-03-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -203,7 +203,9 @@ files:
203
203
  - _includes/apple-touch-startup-images.md
204
204
  - _includes/card-horizontal-list.html
205
205
  - _includes/card-list.html
206
+ - _includes/card-overview.html
206
207
  - _includes/card.html
208
+ - _includes/doc-container.html
207
209
  - _includes/github.html
208
210
  - _includes/google_analytics.html
209
211
  - _includes/img/merchants/logo-coop.svg