jekyll-open-sdg-plugins 2.2.0 → 2.3.0.pre.beta3

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: 42253f06ce97a31363e04e179de524b96fc15e4fa72a278baa66ec50d1a62402
4
- data.tar.gz: 991ab6a8dc272ce288e5f887e565ec0cd57a11a70816a8c5a79b277589f0f7fc
3
+ metadata.gz: 4944fa0ac86eba4e83bf4f3968446d4750af37f341e4f286dfe115faae4119da
4
+ data.tar.gz: 064bdf7b8c764545426078ea071dadc7ee6a0312a90c67f463e66140fd95f37a
5
5
  SHA512:
6
- metadata.gz: a50172e38b2341293300c7c0a8d861e1b37ba54d9787cb405df81d2a6923e7191941cc14591066fc7fb1c1a635d24092e8db21301c3a8c4f363c79e330a709d0
7
- data.tar.gz: 3c1678ff870ef6d9d84ff0ed84a63650a881344650a94ed84fdf066025b16cbf6b4001e0adf0a8fe8b6c742d0afeee0f123db6af571f14db4386b88e14740b00
6
+ metadata.gz: ec3a89e0a127bf08518ac704c4824b35c0b9a02eaa31c44f7bfa65b00362efd6a3a6ce5a87b3ea8578b5ba56c004ca7f323248e42aacf3d8e09a992e739aca7a
7
+ data.tar.gz: 5e5bf4015c3ba53b6d395dd5c3bfd0381813cec35b1a7c2c5d16141ce23e4df79441ac90a8a5d0466fbeb587d7fead29b500406623788b80384001c0812224de
@@ -6,12 +6,16 @@ jobs:
6
6
  test:
7
7
 
8
8
  runs-on: ubuntu-latest
9
+ strategy:
10
+ matrix:
11
+ ruby: [ '2.6', '2.7', '3.2' ]
9
12
 
13
+ name: Ruby ${{ matrix.ruby }} test
10
14
  steps:
11
15
  - uses: actions/checkout@v1
12
16
  - name: Set up Ruby 2.6
13
17
  uses: ruby/setup-ruby@v1
14
18
  with:
15
- ruby-version: '2.6'
19
+ ruby-version: ${{ matrix.ruby }}
16
20
  - name: Run all tests
17
21
  run: make test
@@ -13,6 +13,10 @@ module JekyllOpenSdgPlugins
13
13
  form_settings_config = site.config['indicator_config_form']
14
14
  form_settings_meta = site.config['indicator_metadata_form']
15
15
  form_settings_data = site.config['indicator_data_form']
16
+ config_builder_layout = 'config-builder'
17
+ #if site.config['use_new_config_forms']
18
+ # config_builder_layout = 'config-builder-2'
19
+ #end
16
20
 
17
21
  translations = site.data['translations']
18
22
  # If site.create_indicators is set, create indicators per the metadata.
@@ -44,6 +48,11 @@ module JekyllOpenSdgPlugins
44
48
 
45
49
  # Create the indicator page.
46
50
  site.collections['indicators'].docs << IndicatorPage.new(site, site.source, dir, inid, language, layout)
51
+ # Also create the iframe version.
52
+ iframe_layout = 'indicator-iframe'
53
+ iframe_permalink = permalink + '-iframe'
54
+ iframe_dir = index == 0 ? iframe_permalink : File.join(language_public, iframe_permalink)
55
+ site.collections['pages'].docs << IndicatorPage.new(site, site.source, iframe_dir, inid, language, iframe_layout)
47
56
  end
48
57
  end
49
58
  # Create the indicator settings configuration/metadata/data pages.
@@ -105,7 +114,7 @@ module JekyllOpenSdgPlugins
105
114
  dir = File.join(dir_base, 'config')
106
115
  title = opensdg_translate_key('indicator.edit_configuration', translations, language)
107
116
  config_type = 'indicator'
108
- site.collections['pages'].docs << IndicatorConfigPage.new(site, site.source, dir, inid, language, meta, title, config_type, form_settings_config)
117
+ site.collections['pages'].docs << IndicatorConfigPage.new(site, site.source, dir, inid, language, meta, title, config_type, form_settings_config, config_builder_layout)
109
118
  end
110
119
 
111
120
  if do_indicator_meta_forms
@@ -116,7 +125,7 @@ module JekyllOpenSdgPlugins
116
125
  dir = File.join(dir_base, 'metadata')
117
126
  title = opensdg_translate_key('indicator.edit_metadata', translations, language)
118
127
  config_type = 'metadata'
119
- site.collections['pages'].docs << IndicatorConfigPage.new(site, site.source, dir, inid, language, metadata_to_use, title, config_type, form_settings_meta)
128
+ site.collections['pages'].docs << IndicatorConfigPage.new(site, site.source, dir, inid, language, metadata_to_use, title, config_type, form_settings_meta, config_builder_layout)
120
129
  end
121
130
 
122
131
  if do_indicator_data_forms
@@ -150,7 +159,7 @@ module JekyllOpenSdgPlugins
150
159
 
151
160
  # A Page subclass used in the `CreateIndicators` class for the indicator config forms.
152
161
  class IndicatorConfigPage < Jekyll::Page
153
- def initialize(site, base, dir, inid, language, meta, title, config_type, form_settings)
162
+ def initialize(site, base, dir, inid, language, meta, title, config_type, form_settings, layout)
154
163
  @site = site
155
164
  @base = base
156
165
  @dir = dir
@@ -161,7 +170,7 @@ module JekyllOpenSdgPlugins
161
170
  self.data['language'] = language
162
171
  self.data['indicator_number'] = inid
163
172
  self.data['config_type'] = config_type
164
- self.data['layout'] = 'config-builder'
173
+ self.data['layout'] = layout
165
174
  self.data['meta'] = meta
166
175
  self.data['title'] = title + ': ' + inid.gsub('-', '.')
167
176
  self.data['config_filename'] = inid + '.yml'
@@ -89,11 +89,15 @@ module JekyllOpenSdgPlugins
89
89
  # Hardcode the site configuration page if it's not already there.
90
90
  form_settings = site.config['site_config_form']
91
91
  config_page = pages.find { |page| page['layout'] == 'config-builder' }
92
+ config_builder_layout = 'config-builder'
93
+ if site.config['use_new_config_forms']
94
+ config_builder_layout = 'config-builder-2'
95
+ end
92
96
  if config_page == nil
93
97
  if form_settings && form_settings['enabled']
94
98
  pages.push({
95
99
  'folder' => '/config',
96
- 'layout' => 'config-builder',
100
+ 'layout' => config_builder_layout,
97
101
  'title' => 'Open SDG site configuration',
98
102
  'config_type' => 'site',
99
103
  'config_filename' => 'site_config.yml',
@@ -101,7 +105,7 @@ module JekyllOpenSdgPlugins
101
105
  end
102
106
  end
103
107
  # Make sure the form settings are set.
104
- config_page = pages.find { |page| page['layout'] == 'config-builder' }
108
+ config_page = pages.find { |page| page['layout'] == config_builder_layout }
105
109
  if config_page != nil && form_settings && form_settings['enabled']
106
110
  config_page['form_settings'] = form_settings
107
111
  end
@@ -39,7 +39,7 @@ module JekyllOpenSdgPlugins
39
39
  endpoint = is_remote ? path + '/' + value : File.join(path, fix_path(value))
40
40
 
41
41
  begin
42
- json_file = is_remote ? open(endpoint) : File.open(endpoint)
42
+ json_file = is_remote ? URI.open(endpoint) : File.open(endpoint)
43
43
  build[key] = JSON.load(json_file)
44
44
  rescue StandardError => e
45
45
  # For backwards compatibility, forego the exception in some cases.
@@ -10,7 +10,7 @@ module JekyllOpenSdgPlugins
10
10
 
11
11
  routes = {}
12
12
  baseurl = ''
13
- if site.config.has_key?('baseurl')
13
+ if site.config.has_key?('baseurl') and site.config['baseurl'].is_a?(String)
14
14
  baseurl = site.config['baseurl']
15
15
  end
16
16
  unless baseurl.end_with?('/')
@@ -26,7 +26,7 @@ module JekyllOpenSdgPlugins
26
26
  route = route + '/'
27
27
  end
28
28
 
29
- unless doc.data['layout'] == 'config-builder' or doc.data['layout'] == 'data-editor'
29
+ unless doc.data['layout'] == 'config-builder' or doc.data['layout'] == 'data-editor' or doc.data['layout'] == 'config-builder-2'
30
30
  routes['pages'].append(route)
31
31
  end
32
32
  end
@@ -40,7 +40,7 @@ module JekyllOpenSdgPlugins
40
40
  route = route + '/'
41
41
  end
42
42
 
43
- if doc.data['layout'] == 'config-builder' or doc.data['layout'] == 'data-editor'
43
+ if doc.data['layout'] == 'config-builder' or doc.data['layout'] == 'data-editor' or doc.data['layout'] == 'config-builder-2'
44
44
  routes['config'].append(route)
45
45
  end
46
46
  end
@@ -310,6 +310,8 @@
310
310
  "title": "Position",
311
311
  "description": "Placement of the label along the line.",
312
312
  "enum": [
313
+ "start",
314
+ "end",
313
315
  "top",
314
316
  "bottom",
315
317
  "left",
@@ -326,7 +328,14 @@
326
328
  "fontColor": {
327
329
  "type": "string",
328
330
  "format": "color",
329
- "title": "Label color",
331
+ "title": "Label color (do not use)",
332
+ "description": "[DEPRECATED: USE 'Label color (use this)' INSTEAD]",
333
+ "default": "#000000"
334
+ },
335
+ "color": {
336
+ "type": "string",
337
+ "format": "color",
338
+ "title": "Label color (use this)",
330
339
  "description": "Color for the label text.",
331
340
  "default": "#000000"
332
341
  },
@@ -360,7 +369,14 @@
360
369
  "type": "string",
361
370
  "format": "color",
362
371
  "default": "#ffffff",
363
- "title": "High-contrast label color",
372
+ "title": "High-contrast label color (do not use)",
373
+ "description": "[DEPRECATED: USE 'High-contrast label color (use this)' INSTEAD]"
374
+ },
375
+ "color": {
376
+ "type": "string",
377
+ "format": "color",
378
+ "default": "#ffffff",
379
+ "title": "High-contrast label color (use this)",
364
380
  "description": "Color for the label text in high-contrast mode."
365
381
  },
366
382
  "backgroundColor": {
@@ -1203,6 +1203,36 @@
1203
1203
  }
1204
1204
  ]
1205
1205
  },
1206
+ "observation_attributes": {
1207
+ "options": {"collapsed": true},
1208
+ "type": "array",
1209
+ "title": "Observation attributes",
1210
+ "description": "This setting can be used to specify data columns to be considered 'observation attributes' and displayed along with individual data-points.",
1211
+ "items": {
1212
+ "type": "object",
1213
+ "title": "Observation attribute",
1214
+ "properties": {
1215
+ "field": {
1216
+ "type": "string",
1217
+ "minLength": 1,
1218
+ "title": "Field",
1219
+ "description": "Column name in the data."
1220
+ },
1221
+ "label": {
1222
+ "type": "string",
1223
+ "minLength": 1,
1224
+ "title": "Label",
1225
+ "description": "Optional label when displayed in footnotes."
1226
+ }
1227
+ }
1228
+ },
1229
+ "links": [
1230
+ {
1231
+ "rel": "More information on the observation attributes setting",
1232
+ "href": "https://open-sdg.readthedocs.io/en/latest/configuration/#observation_attributes"
1233
+ }
1234
+ ]
1235
+ },
1206
1236
  "progress_status": {
1207
1237
  "options": {"collapsed": true},
1208
1238
  "type": "object",
@@ -1335,6 +1365,11 @@
1335
1365
  { "$ref": "#/definitions/title_and_description" },
1336
1366
  {
1337
1367
  "properties": {
1368
+ "disaggregation_indicator_count_label": {
1369
+ "title": "Disaggregation indicator count label",
1370
+ "type": "string",
1371
+ "description": "An alternative label to use for the indicator count on the disaggregation tab, to be display after a number."
1372
+ },
1338
1373
  "disaggregation_tabs": {
1339
1374
  "title": "Disaggregation tabs",
1340
1375
  "type": "boolean",
@@ -1486,6 +1521,18 @@
1486
1521
  }
1487
1522
  ]
1488
1523
  },
1524
+ "use_new_config_forms": {
1525
+ "title": "Use new config forms",
1526
+ "type": "boolean",
1527
+ "description": "This setting can be set to `true` to try the new site configuration forms. This is experimental and will eventually be the default.",
1528
+ "format": "checkbox",
1529
+ "links": [
1530
+ {
1531
+ "rel": "More information on the use_new_config_forms setting",
1532
+ "href": "https://open-sdg.readthedocs.io/en/latest/configuration/#use_new_config_forms"
1533
+ }
1534
+ ]
1535
+ },
1489
1536
  "validate_indicator_config": {
1490
1537
  "title": "Validate indicator config",
1491
1538
  "type": "boolean",
@@ -541,7 +541,7 @@ module JekyllOpenSdgPlugins
541
541
  end
542
542
  doc.data['logo'] = logo
543
543
 
544
- if collection == 'indicators'
544
+ if collection == 'indicators' || doc.data['layout'] == 'indicator-iframe'
545
545
  # For indicators we also set the current indicator/target/goal.
546
546
  if doc.data.has_key? 'indicator_number'
547
547
  indicator_number = doc.data['indicator_number']
@@ -36,7 +36,7 @@ module JekyllOpenSdgPlugins
36
36
  site.collections.keys.each do |collection|
37
37
  site.collections[collection].docs.each do |doc|
38
38
  # Do not index configuration forms.
39
- if doc.data.has_key?('layout') && doc.data['layout'] == 'config-builder'
39
+ if doc.data.has_key?('layout') && (doc.data['layout'] == 'config-builder' or doc.data['layout'] == 'config-builder-2')
40
40
  next
41
41
  end
42
42
  # We segregate the search items by language.
@@ -1,3 +1,3 @@
1
1
  module JekyllOpenSdgPlugins
2
- VERSION = "2.2.0".freeze
2
+ VERSION = "2.3.0-beta3".freeze
3
3
  end
data/tests/Gemfile CHANGED
@@ -1,7 +1,9 @@
1
1
  source "https://rubygems.org"
2
2
 
3
- gem "jekyll", "3.8.4"
4
- gem "html-proofer"
3
+ gem "jekyll", "3.9.3"
4
+ gem "html-proofer", "3.19.4"
5
5
  gem "jekyll-remote-theme"
6
6
  gem "deep_merge"
7
7
  gem "json_schemer"
8
+ gem "kramdown-parser-gfm"
9
+ gem "webrick"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-open-sdg-plugins
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.0
4
+ version: 2.3.0.pre.beta3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brock Fanning
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-04-27 00:00:00.000000000 Z
11
+ date: 2024-02-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll
@@ -104,11 +104,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
104
104
  version: '0'
105
105
  required_rubygems_version: !ruby/object:Gem::Requirement
106
106
  requirements:
107
- - - ">="
107
+ - - ">"
108
108
  - !ruby/object:Gem::Version
109
- version: '0'
109
+ version: 1.3.1
110
110
  requirements: []
111
- rubygems_version: 3.1.4
111
+ rubygems_version: 3.0.9
112
112
  signing_key:
113
113
  specification_version: 4
114
114
  summary: Jekyll plugins for use with the Open SDG platform