jekyll-open-sdg-plugins 1.2.0.pre.beta5 → 1.3.1

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: 55f3d80d4acc19d67bb4d70f17c1297f04ec33d313e7a26e34a2f82e63c8c91c
4
- data.tar.gz: 524cf624a527082236c885139cc0b2582c8b9ace8cf7d57292e2c74e8e076ebe
3
+ metadata.gz: 2b8207e00fee9b06651b035048a46ebf9c3feaa83c34a389411b11d9b1f5c859
4
+ data.tar.gz: 6f36f1ce30f97de9228082af5aede9750b0155caace3c92dd44bd11f89107f1b
5
5
  SHA512:
6
- metadata.gz: d7da9b8f7fb2399ec8de5b90866fe7fab567ac4feeba5f4a91f6c4a7e550d498506caf649b6153c13befe51bcc80d71fc2da22ba74f62ac45e4cb47dfb246ba1
7
- data.tar.gz: 2497c3cfec27dd90cab528becda64da55f14521f6e5cfbfb0b6399df14072d96cd930e8675b6c8d5959d850c5c2b658c31da4510c6ad1515d3c88f61399b41c5
6
+ metadata.gz: 5857e831f608586fa54ddde293d6a127c6907361c2f758837c8cba7f78802fca1da1df9d7a5ab8ba69774cb8f242b0297a905db8bea8f4ca7a479c909492575a
7
+ data.tar.gz: f5b4950adf873e5a1db34452430fc87b23ae5cf189748e17ea6a3e03a236a3292a6b7029b4a80267281017a7030e5e81085d2658d302bb07286c59af9e721b7f
@@ -23,6 +23,9 @@ module JekyllOpenSdgPlugins
23
23
  metadata = site.data['meta']
24
24
  end
25
25
  metadata.each do |inid, indicator|
26
+ if indicator.has_key?('standalone') and indicator['standalone']
27
+ next
28
+ end
26
29
  goal = inid.split('-')[0].to_i
27
30
  goals[goal] = true
28
31
  end
@@ -60,6 +63,14 @@ module JekyllOpenSdgPlugins
60
63
  @dir = dir
61
64
  @name = 'index.html'
62
65
 
66
+ goal_content = ''
67
+ if site.config['create_goals'].has_key?('goals')
68
+ if !site.config['create_goals']['goals'][goal - 1].nil?
69
+ goal_content = site.config['create_goals']['goals'][goal - 1]['content']
70
+ end
71
+ end
72
+ @content = goal_content
73
+
63
74
  self.process(@name)
64
75
  self.data = {}
65
76
  self.data['goal_number'] = goal.to_s
@@ -34,8 +34,13 @@ module JekyllOpenSdgPlugins
34
34
  end
35
35
  # Loop through the indicators (using metadata as a list).
36
36
  metadata.each do |inid, meta|
37
+ permalink = inid
38
+ if meta.has_key?('permalink') and meta['permalink'] != ''
39
+ permalink = meta['permalink']
40
+ end
37
41
  # Add the language subfolder for all except the default (first) language.
38
- dir = index == 0 ? inid : File.join(language_public, inid)
42
+ dir = index == 0 ? permalink : File.join(language_public, permalink)
43
+
39
44
  # Create the indicator page.
40
45
  site.collections['indicators'].docs << IndicatorPage.new(site, site.source, dir, inid, language, layout)
41
46
  end
@@ -64,9 +69,13 @@ module JekyllOpenSdgPlugins
64
69
  language_public = languages_public[language]
65
70
  end
66
71
  metadata.each do |inid, meta|
67
- dir = File.join('config', inid)
72
+ permalink = inid
73
+ if meta.has_key?('permalink') and meta['permalink'] != ''
74
+ permalink = meta['permalink']
75
+ end
76
+ dir = File.join('config', permalink)
68
77
  if index != 0
69
- dir = File.join(language_public, 'config', inid)
78
+ dir = File.join(language_public, 'config', permalink)
70
79
  end
71
80
  site.collections['pages'].docs << IndicatorConfigPage.new(site, site.source, dir, inid, language, meta, layout)
72
81
  end
@@ -3,6 +3,17 @@
3
3
  "title": "Open SDG indicator configuration",
4
4
  "description": "This form will produce an indicator's configuration for your Open SDG implementation.",
5
5
  "properties": {
6
+ "composite_breakdown_label": {
7
+ "type": "string",
8
+ "title": "Composite breakdown label",
9
+ "description": "Used as a label for the COMPOSITE_BREAKDOWN column, if it appears in the indicator data.",
10
+ "links": [
11
+ {
12
+ "rel": "More information on the composite breakdown label setting",
13
+ "href": "https://open-sdg.readthedocs.io/en/latest/metadata-format/#composite-breakdown-label"
14
+ }
15
+ ]
16
+ },
6
17
  "computation_units": {
7
18
  "type": "string",
8
19
  "title": "Unit of measurement",
@@ -97,7 +108,6 @@
97
108
  },
98
109
  "data_start_values": {
99
110
  "options": {"collapsed": true},
100
- "format": "table",
101
111
  "type": "array",
102
112
  "title": "Starting values",
103
113
  "description": "Disaggregation values for a an indicator to start with already selected",
@@ -186,7 +196,6 @@
186
196
  },
187
197
  "expected_disaggregations": {
188
198
  "options": {"collapsed": true},
189
- "format": "table",
190
199
  "type": "array",
191
200
  "title": "Expected disaggregations",
192
201
  "description": "An optional list of disaggregations (ie, data column names) to use when calculating the disaggregation status statistics.",
@@ -209,142 +218,131 @@
209
218
  "items": {
210
219
  "type": "object",
211
220
  "title": "Graph annotation",
212
- "properties": {
213
- "preset": {
214
- "type": "string",
215
- "title": "Preset",
216
- "enum": ["target_line"],
217
- "description": "A preset bundle of configurations."
218
- },
219
- "value": {
220
- "type": "number",
221
- "minimum": 0,
222
- "title": "Value",
223
- "description": "The value at which to draw the line. For horizontal lines, this number corresponds to your actual data. For vertical lines, this number should be between 0 (the left side of the chart) and the number of years minus 1 (the right side of the chart)."
224
- },
225
- "endValue": {
226
- "type": "number",
227
- "title": "End value",
228
- "description": "Optionally add a different ending value for the line."
229
- },
230
- "description": {
231
- "type": "string",
232
- "title": "Description",
233
- "description": "A description of the annotation to be read by screenreaders."
234
- },
235
- "unit": {
236
- "type": "string",
237
- "title": "Unit",
238
- "description": "The unit of measurement the annotation displays on."
239
- },
240
- "series": {
241
- "type": "string",
242
- "title": "Series",
243
- "description": "The series the annotation displays on."
244
- },
245
- "mode": {
246
- "type": "string",
247
- "title": "Mode",
248
- "description": "Whether the line will be vertical or horizontal.",
249
- "enum": ["horizontal", "vertical"]
250
- },
251
- "borderColor": {
252
- "type": "string",
253
- "format": "color",
254
- "title": "Line color",
255
- "description": "The color of the line.",
256
- "links": [
257
- {
258
- "rel": "More information on the border color setting",
259
- "href": "https://github.com/chartjs/chartjs-plugin-annotation/blob/master/README.md"
260
- }
261
- ]
262
- },
263
- "borderDash": {
264
- "type": "string",
265
- "title": "Line dash type",
266
- "description": "The type of line dash.",
267
- "links": [
268
- {
269
- "rel": "More information on the line dash setting",
270
- "href": "https://github.com/chartjs/chartjs-plugin-annotation/blob/master/README.md"
271
- }
272
- ]
273
- },
274
- "label": {
275
- "type": "object",
276
- "title": "Label",
277
- "description": "A text label for the annotation.",
221
+ "allOf": [
222
+ { "$ref": "#/definitions/series_unit_constraint" },
223
+ {
278
224
  "properties": {
279
- "position": {
280
- "type": "string",
281
- "title": "Position",
282
- "description": "Placement of the label along the line.",
283
- "enum": [
284
- "top",
285
- "bottom",
286
- "left",
287
- "right",
288
- "center"
289
- ]
225
+ "value": {
226
+ "type": "number",
227
+ "minimum": 0,
228
+ "title": "Value",
229
+ "description": "The value at which to draw the line. For horizontal lines, this number corresponds to your actual data. For vertical lines, this number should be between 0 (the left side of the chart) and the number of years minus 1 (the right side of the chart)."
290
230
  },
291
- "content": {
292
- "type": "string",
293
- "minLength": 1,
294
- "title": "Content",
295
- "description": "Text of the line label."
231
+ "endValue": {
232
+ "type": "number",
233
+ "title": "End value",
234
+ "description": "Optionally add a different ending value for the line."
296
235
  },
297
- "fontColor": {
236
+ "description": {
298
237
  "type": "string",
299
- "format": "color",
300
- "title": "Label color",
301
- "description": "Color for the label text."
238
+ "title": "Description",
239
+ "description": "A description of the annotation to be read by screenreaders."
302
240
  },
303
- "backgroundColor": {
241
+ "mode": {
304
242
  "type": "string",
305
- "format": "color",
306
- "default": "#FFFFFFF",
307
- "title": "Background color",
308
- "description": "Background color for the label text."
309
- }
310
- }
311
- },
312
- "highContrast": {
313
- "type": "object",
314
- "title": "High contrast options",
315
- "description": "High-contrast overrides of certain color.",
316
- "properties": {
243
+ "title": "Mode",
244
+ "description": "Whether the line will be vertical or horizontal.",
245
+ "enum": ["horizontal", "vertical"]
246
+ },
317
247
  "borderColor": {
318
248
  "type": "string",
319
249
  "format": "color",
320
- "default": "#FFFFFF",
321
- "title": "High-contrast line color",
322
- "description": "The color of the line in high-contrast mode."
250
+ "title": "Line color",
251
+ "description": "The color of the line.",
252
+ "links": [
253
+ {
254
+ "rel": "More information on the border color setting",
255
+ "href": "https://github.com/chartjs/chartjs-plugin-annotation/blob/master/README.md"
256
+ }
257
+ ]
258
+ },
259
+ "borderDash": {
260
+ "type": "string",
261
+ "title": "Line dash type",
262
+ "description": "The type of line dash.",
263
+ "links": [
264
+ {
265
+ "rel": "More information on the line dash setting",
266
+ "href": "https://github.com/chartjs/chartjs-plugin-annotation/blob/master/README.md"
267
+ }
268
+ ]
323
269
  },
324
270
  "label": {
325
271
  "type": "object",
326
- "title": "High contrast label",
327
- "description": "High-contrast version of the label.",
272
+ "title": "Label",
273
+ "description": "A text label for the annotation.",
328
274
  "properties": {
275
+ "position": {
276
+ "type": "string",
277
+ "title": "Position",
278
+ "description": "Placement of the label along the line.",
279
+ "enum": [
280
+ "top",
281
+ "bottom",
282
+ "left",
283
+ "right",
284
+ "center"
285
+ ]
286
+ },
287
+ "content": {
288
+ "type": "string",
289
+ "minLength": 1,
290
+ "title": "Content",
291
+ "description": "Text of the line label."
292
+ },
329
293
  "fontColor": {
330
294
  "type": "string",
331
295
  "format": "color",
332
- "default": "#FFFFFF",
333
- "title": "High-contrast label color",
334
- "description": "Color for the label text in high-contrast mode."
296
+ "title": "Label color",
297
+ "description": "Color for the label text."
335
298
  },
336
299
  "backgroundColor": {
337
300
  "type": "string",
338
301
  "format": "color",
339
- "default": "#000000",
340
- "title": "High-contrast background color",
341
- "description": "Background color for the label text in high-contrast mode."
302
+ "default": "#FFFFFFF",
303
+ "title": "Background color",
304
+ "description": "Background color for the label text."
305
+ }
306
+ }
307
+ },
308
+ "highContrast": {
309
+ "type": "object",
310
+ "title": "High contrast options",
311
+ "description": "High-contrast overrides of certain color.",
312
+ "properties": {
313
+ "borderColor": {
314
+ "type": "string",
315
+ "format": "color",
316
+ "default": "#FFFFFF",
317
+ "title": "High-contrast line color",
318
+ "description": "The color of the line in high-contrast mode."
319
+ },
320
+ "label": {
321
+ "type": "object",
322
+ "title": "High contrast label",
323
+ "description": "High-contrast version of the label.",
324
+ "properties": {
325
+ "fontColor": {
326
+ "type": "string",
327
+ "format": "color",
328
+ "default": "#FFFFFF",
329
+ "title": "High-contrast label color",
330
+ "description": "Color for the label text in high-contrast mode."
331
+ },
332
+ "backgroundColor": {
333
+ "type": "string",
334
+ "format": "color",
335
+ "default": "#000000",
336
+ "title": "High-contrast background color",
337
+ "description": "Background color for the label text in high-contrast mode."
338
+ }
339
+ }
342
340
  }
343
341
  }
344
342
  }
345
343
  }
346
344
  }
347
- }
345
+ ]
348
346
  },
349
347
  "links": [
350
348
  {
@@ -355,37 +353,31 @@
355
353
  },
356
354
  "graph_limits": {
357
355
  "options": {"collapsed": true},
358
- "format": "table",
359
356
  "type": "array",
360
357
  "title": "Graph limits",
361
358
  "description": "A list of min/max limits controlling the lowest/highest values to be shown on the y-axis.",
362
359
  "items": {
363
360
  "type": "object",
364
361
  "title": "Graph limit",
365
- "properties": {
366
- "minimum": {
367
- "type": "number",
368
- "minimum": 0,
369
- "title": "Minimum",
370
- "description": "Minimum value for the y axis."
371
- },
372
- "maximum": {
373
- "type": "number",
374
- "minimum": 0,
375
- "title": "Maximum",
376
- "description": "Maximum value for the y axis."
377
- },
378
- "unit": {
379
- "type": "string",
380
- "title": "Unit",
381
- "description": "The unit of measurement the limits apply to."
382
- },
383
- "series": {
384
- "type": "string",
385
- "title": "Series",
386
- "description": "The series the limits apply to."
362
+ "allOf": [
363
+ { "$ref": "#/definitions/series_unit_constraint" },
364
+ {
365
+ "properties": {
366
+ "minimum": {
367
+ "type": "number",
368
+ "minimum": 0,
369
+ "title": "Minimum",
370
+ "description": "Minimum value for the y axis."
371
+ },
372
+ "maximum": {
373
+ "type": "number",
374
+ "minimum": 0,
375
+ "title": "Maximum",
376
+ "description": "Maximum value for the y axis."
377
+ }
378
+ }
387
379
  }
388
- }
380
+ ]
389
381
  },
390
382
  "links": [
391
383
  {
@@ -418,31 +410,25 @@
418
410
  },
419
411
  "graph_titles": {
420
412
  "options": {"collapsed": true},
421
- "format": "table",
422
413
  "type": "array",
423
414
  "title": "Graph titles",
424
415
  "description": "As an alternative to `graph_title`, this can be used to set specific titles for particular units and/or series.",
425
416
  "items": {
426
417
  "type": "object",
427
418
  "title": "Graph title",
428
- "properties": {
429
- "title": {
430
- "type": "string",
431
- "minLength": 1,
432
- "title": "Title",
433
- "description": "The graph title."
434
- },
435
- "unit": {
436
- "type": "string",
437
- "title": "Unit",
438
- "description": "The unit of measurement the title applies to."
439
- },
440
- "series": {
441
- "type": "string",
442
- "title": "Series",
443
- "description": "The series the title applies to."
419
+ "allOf": [
420
+ { "$ref": "#/definitions/series_unit_constraint" },
421
+ {
422
+ "properties": {
423
+ "title": {
424
+ "type": "string",
425
+ "minLength": 1,
426
+ "title": "Title",
427
+ "description": "The graph title."
428
+ }
429
+ }
444
430
  }
445
- }
431
+ ]
446
432
  }
447
433
  },
448
434
  "graph_type": {
@@ -496,6 +482,39 @@
496
482
  "title": "Page content",
497
483
  "description": "Content which displays in the main content area of the indicator page."
498
484
  },
485
+ "permalink": {
486
+ "type": "string",
487
+ "title": "Permalink",
488
+ "description": "Overrides the normal path of the indicator page. Not recommended, execpt for 'standalone' indicators.",
489
+ "links": [
490
+ {
491
+ "rel": "More information the permalink setting",
492
+ "href": "https://open-sdg.readthedocs.io/en/latest/metadata-format/#standalone-indicators"
493
+ }
494
+ ]
495
+ },
496
+ "precision": {
497
+ "options": {"collapsed": true},
498
+ "type": "array",
499
+ "title": "Precision rules",
500
+ "description": "Control the number of decimal places for data in this indicator.",
501
+ "items": {
502
+ "type": "object",
503
+ "title": "Precision rule",
504
+ "allOf": [
505
+ { "$ref": "#/definitions/series_unit_constraint" },
506
+ {
507
+ "properties": {
508
+ "decimals": {
509
+ "type": "number",
510
+ "title": "Decimals",
511
+ "description": "The number of decimal places"
512
+ }
513
+ }
514
+ }
515
+ ]
516
+ }
517
+ },
499
518
  "reporting_status": {
500
519
  "type": "string",
501
520
  "title": "Reporting status",
@@ -508,9 +527,31 @@
508
527
  }
509
528
  ]
510
529
  },
530
+ "sort": {
531
+ "type": "string",
532
+ "title": "Sort order",
533
+ "description": "Override the default order in which this indicator is displayed in lists. This can be left blank, and it will be automatically determined.",
534
+ "links": [
535
+ {
536
+ "rel": "More information on the sort setting",
537
+ "href": "https://open-sdg.readthedocs.io/en/latest/metadata-format/#sorting-in-lists"
538
+ }
539
+ ]
540
+ },
541
+ "standalone": {
542
+ "title": "Standalone indicator",
543
+ "type": "boolean",
544
+ "description": "Whether the indicator is standalone (separate from the SDGs) or not.",
545
+ "format": "checkbox",
546
+ "links": [
547
+ {
548
+ "rel": "More information the standalone setting",
549
+ "href": "https://open-sdg.readthedocs.io/en/latest/metadata-format/#standalone-indicators"
550
+ }
551
+ ]
552
+ },
511
553
  "tags": {
512
554
  "options": {"collapsed": true},
513
- "format": "table",
514
555
  "type": "array",
515
556
  "title": "Tags",
516
557
  "description": "An optional list of 'tags' to display under an indicator when it is listed on its goal page.",
@@ -526,5 +567,22 @@
526
567
  ]
527
568
  }
528
569
  },
529
- "additionalProperties": true
570
+ "additionalProperties": true,
571
+ "definitions": {
572
+ "series_unit_constraint": {
573
+ "type": "object",
574
+ "properties": {
575
+ "series": {
576
+ "type": "string",
577
+ "title": "Series",
578
+ "description": "Limit to this particular series"
579
+ },
580
+ "unit": {
581
+ "type": "string",
582
+ "title": "Unit",
583
+ "description": "Limit to this particular unit"
584
+ }
585
+ }
586
+ }
587
+ }
530
588
  }
@@ -54,7 +54,6 @@
54
54
  "properties": {
55
55
  "goal": {
56
56
  "options": {"collapsed": true},
57
- "format": "table",
58
57
  "type": "array",
59
58
  "title": "Goal breadcrumbs",
60
59
  "description": "The breadcrumb items for goal pages.",
@@ -64,7 +63,6 @@
64
63
  },
65
64
  "indicator": {
66
65
  "options": {"collapsed": true},
67
- "format": "table",
68
66
  "type": "array",
69
67
  "title": "Indicator breadcrumbs",
70
68
  "description": "The breadcrumb items for indicator pages. Note that there will automatically be a final item, which is a link to the goal that the indicator belongs to. You do not need to specify this, since it is done dynamically and automatically.",
@@ -74,7 +72,6 @@
74
72
  },
75
73
  "post": {
76
74
  "options": {"collapsed": true},
77
- "format": "table",
78
75
  "type": "array",
79
76
  "title": "Post breadcrumbs",
80
77
  "description": "The breadcrumb items for post pages.",
@@ -169,6 +166,30 @@
169
166
  ]
170
167
  },
171
168
  "description": "The layout to use for the goal pages."
169
+ },
170
+ "previous_next_links": {
171
+ "title": "Previous/next links",
172
+ "type": "boolean",
173
+ "description": "This setting can be used to show navigation links to the previous/next goals.",
174
+ "format": "checkbox"
175
+ },
176
+ "goals": {
177
+ "options": {"collapsed": true},
178
+ "type": "array",
179
+ "title": "Content per goal",
180
+ "description": "This setting can be used to enter details for each goal.",
181
+ "items": {
182
+ "type": "object",
183
+ "title": "Goal",
184
+ "properties": {
185
+ "content": {
186
+ "type": "string",
187
+ "title": "Content",
188
+ "format": "markdown",
189
+ "description": "Markdown content or a translation key for this goal."
190
+ }
191
+ }
192
+ }
172
193
  }
173
194
  },
174
195
  "links": [
@@ -198,6 +219,12 @@
198
219
  ]
199
220
  },
200
221
  "description": "The layout to use for the indicator pages."
222
+ },
223
+ "previous_next_links": {
224
+ "title": "Previous/next links",
225
+ "type": "boolean",
226
+ "description": "This setting can be used to show navigation links to the previous/next indicators.",
227
+ "format": "checkbox"
201
228
  }
202
229
  },
203
230
  "links": [
@@ -209,7 +236,6 @@
209
236
  },
210
237
  "create_pages": {
211
238
  "options": {"collapsed": true},
212
- "format": "table",
213
239
  "type": "array",
214
240
  "title": "Create pages",
215
241
  "description": "This setting can be used to automatically create the pages.",
@@ -250,7 +276,6 @@
250
276
  },
251
277
  "custom_css": {
252
278
  "options": {"collapsed": true},
253
- "format": "table",
254
279
  "type": "array",
255
280
  "title": "Custom CSS files",
256
281
  "description": "Deprecated: instead of using this, it is recommended to put custom CSS in a _sass/custom.scss file.",
@@ -267,7 +292,6 @@
267
292
  },
268
293
  "custom_js": {
269
294
  "options": {"collapsed": true},
270
- "format": "table",
271
295
  "type": "array",
272
296
  "title": "Custom JavaScript files",
273
297
  "description": "This setting can be used to load additional JavaScript files on each page.",
@@ -294,9 +318,32 @@
294
318
  }
295
319
  ]
296
320
  },
321
+ "data_fields": {
322
+ "options": {"collapsed": true},
323
+ "type": "object",
324
+ "title": "Data fields",
325
+ "description": "Control the names of fields used for special purposes in data.",
326
+ "properties": {
327
+ "units": {
328
+ "type": "string",
329
+ "title": "Units",
330
+ "description": "Field to reserve for units of measurement. Defaults to 'Units'."
331
+ },
332
+ "series": {
333
+ "type": "string",
334
+ "title": "Series",
335
+ "description": "Field to reserve for the SDG series. Defaults to 'Series'."
336
+ }
337
+ },
338
+ "links": [
339
+ {
340
+ "rel": "More information on the data fields setting",
341
+ "href": "https://open-sdg.readthedocs.io/en/latest/configuration/#data_fields"
342
+ }
343
+ ]
344
+ },
297
345
  "date_formats": {
298
346
  "options": {"collapsed": true},
299
- "format": "table",
300
347
  "type": "array",
301
348
  "title": "Date formats",
302
349
  "description": "This setting can be used to control date formats for use in the site, such as in the news/category/post layouts. Any number date formats can be entered, and each must have an arbitrary type, such as `standard`. Make sure that each type has a variant for each of your languages.",
@@ -417,7 +464,6 @@
417
464
  },
418
465
  "footer_menu": {
419
466
  "options": {"collapsed": true},
420
- "format": "table",
421
467
  "type": "array",
422
468
  "title": "Footer menu",
423
469
  "description": "The links to display in the footer menu.",
@@ -565,12 +611,38 @@
565
611
  }
566
612
  ]
567
613
  },
614
+ "graph_color_headline": {
615
+ "type": "string",
616
+ "format": "color",
617
+ "title": "Graph color for headline",
618
+ "description": "This setting can be used to customize the color used in the chart 'headlines'.",
619
+ "examples": [],
620
+ "links": [
621
+ {
622
+ "rel": "More information on the graph color headline setting",
623
+ "href": "https://open-sdg.readthedocs.io/en/latest/configuration/#graph_color_headline"
624
+ }
625
+ ]
626
+ },
627
+ "graph_color_headline_high_contrast": {
628
+ "type": "string",
629
+ "format": "color",
630
+ "title": "Graph color for headline - high-contrast",
631
+ "description": "This setting can be used to customize the color used in the chart 'headlines' in high-contrast mode.",
632
+ "examples": [],
633
+ "links": [
634
+ {
635
+ "rel": "More information on the graph color headline high-contrast setting",
636
+ "href": "https://open-sdg.readthedocs.io/en/latest/configuration/#graph_color_headline_high_contrast"
637
+ }
638
+ ]
639
+ },
568
640
  "graph_color_set": {
569
641
  "type": "string",
570
642
  "title": "Graph color set",
571
643
  "description": "This setting can be used to customize the color set used in the charts.",
572
644
  "examples": [],
573
- "enum": ["default", "sdg", "goal", "custom"],
645
+ "enum": ["default", "accessible", "sdg", "goal", "custom"],
574
646
  "links": [
575
647
  {
576
648
  "rel": "More information on the graph color set setting",
@@ -580,7 +652,6 @@
580
652
  },
581
653
  "graph_color_list": {
582
654
  "options": {"collapsed": true},
583
- "format": "table",
584
655
  "type": "array",
585
656
  "title": "Graph color list",
586
657
  "description": "This setting can be used to define a set of colors to be used in the charts. This is only used when graph_color_set is 'custom'.",
@@ -608,6 +679,35 @@
608
679
  }
609
680
  ]
610
681
  },
682
+ "header": {
683
+ "options": {"collapsed": true},
684
+ "type": "object",
685
+ "title": "Header",
686
+ "description": "This setting can be used to customise the header.",
687
+ "properties": {
688
+ "include": {
689
+ "type": "string",
690
+ "title": "Include file",
691
+ "enum": [
692
+ "header-default.html",
693
+ "header-menu-left-aligned.html"
694
+ ],
695
+ "options": {
696
+ "enum_titles": [
697
+ "Default header",
698
+ "Menu left-aligned"
699
+ ]
700
+ },
701
+ "description": "The header style to use on all pages."
702
+ }
703
+ },
704
+ "links": [
705
+ {
706
+ "rel": "More information on the header setting",
707
+ "href": "https://open-sdg.readthedocs.io/en/latest/configuration/#header"
708
+ }
709
+ ]
710
+ },
611
711
  "header_language_toggle": {
612
712
  "type": "string",
613
713
  "title": "Header language toggle",
@@ -641,7 +741,6 @@
641
741
  },
642
742
  "languages": {
643
743
  "options": {"collapsed": true},
644
- "format": "table",
645
744
  "type": "array",
646
745
  "minItems": 1,
647
746
  "title": "Languages",
@@ -660,7 +759,6 @@
660
759
  },
661
760
  "languages_public": {
662
761
  "options": {"collapsed": true},
663
- "format": "table",
664
762
  "type": "array",
665
763
  "title": "Language code overrides",
666
764
  "description": "This setting can be used if you are not happy with any of the standard language codes.",
@@ -691,7 +789,6 @@
691
789
  },
692
790
  "map_layers": {
693
791
  "options": {"collapsed": true},
694
- "format": "table",
695
792
  "type": "array",
696
793
  "title": "Map layers",
697
794
  "description": "Configure any number of layers to display on all indicator maps. A minimum of one layer is required to display maps.",
@@ -799,7 +896,6 @@
799
896
  },
800
897
  "styleNormal": {
801
898
  "type": "object",
802
- "format": "table",
803
899
  "title": "Style (normal)",
804
900
  "description": "Style for boundaries in normal state",
805
901
  "$ref": "#/definitions/map_style",
@@ -812,7 +908,6 @@
812
908
  },
813
909
  "styleHighlighted": {
814
910
  "type": "object",
815
- "format": "table",
816
911
  "title": "Style (highlighted)",
817
912
  "description": "Style for boundaries in highlighted state",
818
913
  "$ref": "#/definitions/map_style",
@@ -825,7 +920,6 @@
825
920
  },
826
921
  "styleStatic": {
827
922
  "type": "object",
828
- "format": "table",
829
923
  "title": "Style (static)",
830
924
  "description": "Style for boundaries in static state (map layers using the 'static boundaries' option).",
831
925
  "$ref": "#/definitions/map_style",
@@ -847,13 +941,28 @@
847
941
  },
848
942
  "menu": {
849
943
  "options": {"collapsed": true},
850
- "format": "table",
851
944
  "type": "array",
852
945
  "minItems": 1,
853
946
  "title": "Main menu",
854
947
  "description": "The links to display in the main menu.",
855
948
  "items": {
856
- "$ref": "#/definitions/menu_item"
949
+ "title": "Menu item",
950
+ "allOf": [
951
+ { "$ref": "#/definitions/menu_item" },
952
+ {
953
+ "properties": {
954
+ "dropdown": {
955
+ "title": "Dropdown menu",
956
+ "type": "array",
957
+ "description": "Enter menu items here to turn this into a dropdown.",
958
+ "items": {
959
+ "$ref": "#/definitions/menu_item",
960
+ "title": "Dropdown menu item"
961
+ }
962
+ }
963
+ }
964
+ }
965
+ ]
857
966
  },
858
967
  "links": [
859
968
  {
@@ -876,7 +985,6 @@
876
985
  },
877
986
  "metadata_tabs": {
878
987
  "options": {"collapsed": true},
879
- "format": "table",
880
988
  "type": "array",
881
989
  "title": "Metadata tabs",
882
990
  "description": "This setting can control the metadata tabs which appear on the indicator pages.",
@@ -959,7 +1067,19 @@
959
1067
  "type": "object",
960
1068
  "title": "Reporting status",
961
1069
  "description": "This setting is used in the 'reportingstatus' layout. It can display a title and description above the reporting status page.",
962
- "$ref": "#/definitions/title_and_description",
1070
+ "allOf": [
1071
+ { "$ref": "#/definitions/title_and_description" },
1072
+ {
1073
+ "properties": {
1074
+ "disaggregation_tabs": {
1075
+ "title": "Disaggregation tabs",
1076
+ "type": "boolean",
1077
+ "description": "Whether or not to display disaggregation status tabs. If you enable this setting, you should also use 'expected_disaggregations' in your indicator configuration, in order to provide the disaggregation status report with useful metrics.",
1078
+ "format": "checkbox"
1079
+ }
1080
+ }
1081
+ }
1082
+ ],
963
1083
  "links": [
964
1084
  {
965
1085
  "rel": "More information on the reporting status setting",
@@ -969,7 +1089,6 @@
969
1089
  },
970
1090
  "search_index_boost": {
971
1091
  "options": {"collapsed": true},
972
- "format": "table",
973
1092
  "type": "array",
974
1093
  "title": "Search index boost",
975
1094
  "description": "This setting can be used to give a boost to one or more fields in the search index.",
@@ -1000,7 +1119,6 @@
1000
1119
  },
1001
1120
  "search_index_extra_fields": {
1002
1121
  "options": {"collapsed": true},
1003
- "format": "table",
1004
1122
  "type": "array",
1005
1123
  "title": "Search index extra fields",
1006
1124
  "description": "This setting can be used to index additional metadata fields in your indicators, for the purposes of affecting the site-wide search.",
@@ -1161,7 +1279,6 @@
1161
1279
  "description": "Set options for any dropdown lists.",
1162
1280
  "items": {
1163
1281
  "type": "object",
1164
- "format": "table",
1165
1282
  "title": "Dropdown list",
1166
1283
  "properties": {
1167
1284
  "jsonschema": {
@@ -1171,7 +1288,6 @@
1171
1288
  },
1172
1289
  "values": {
1173
1290
  "type": "array",
1174
- "format": "table",
1175
1291
  "title": "Values",
1176
1292
  "description": "List of dropdown option values",
1177
1293
  "items": {
@@ -1181,7 +1297,6 @@
1181
1297
  },
1182
1298
  "labels": {
1183
1299
  "type": "array",
1184
- "format": "table",
1185
1300
  "title": "Labels",
1186
1301
  "description": "Optional list of dropdown option labels. Should correspond to the values above.",
1187
1302
  "items": {
@@ -43,6 +43,24 @@ module JekyllOpenSdgPlugins
43
43
  sort_order
44
44
  end
45
45
 
46
+ # Get previous item from an array, or loop to the end.
47
+ def get_previous_item(list, index)
48
+ decremented = index - 1
49
+ if decremented < 0
50
+ decremented = list.length() - 1
51
+ end
52
+ list[decremented]
53
+ end
54
+
55
+ # Get next item from an array, or loop to the beginning.
56
+ def get_next_item(list, index)
57
+ incremented = index + 1
58
+ if incremented >= list.length()
59
+ incremented = 0
60
+ end
61
+ list[incremented]
62
+ end
63
+
46
64
  # The Jekyll baseurl is user-configured, and can be inconsistent. This
47
65
  # ensure it is consistent in whether it starts/ends with a slash.
48
66
  def normalize_baseurl(baseurl)
@@ -170,7 +188,7 @@ module JekyllOpenSdgPlugins
170
188
  goal_image_base = site.config['goal_image_base']
171
189
  end
172
190
  goal_image_extension = 'png'
173
- if site.config.has_key? 'goal_image_extension'
191
+ if site.config.has_key?('goal_image_extension') && site.config['goal_image_extension'] != ''
174
192
  goal_image_extension = site.config['goal_image_extension']
175
193
  end
176
194
 
@@ -209,6 +227,7 @@ module JekyllOpenSdgPlugins
209
227
  goal_number = get_goal_number(indicator_number)
210
228
  target_number = get_target_number(indicator_number)
211
229
  is_global_indicator = global_inids.index(indicator_number) != nil
230
+
212
231
  # To get the name of global stuff, we can use predicable translation
213
232
  # keys from the SDG Translations project. Eg: global_goals.1-title
214
233
  goal_translation_key = 'global_goals.' + goal_number
@@ -253,8 +272,10 @@ module JekyllOpenSdgPlugins
253
272
  end
254
273
  end
255
274
 
275
+ is_standalone = meta.has_key?('standalone') and meta['standalone']
276
+
256
277
  # Set the goal for this language, once only.
257
- if already_added[language].index(goal_number) == nil
278
+ if !is_standalone && already_added[language].index(goal_number) == nil
258
279
  already_added[language].push(goal_number)
259
280
  available_goal = {
260
281
  'number' => goal_number,
@@ -269,7 +290,7 @@ module JekyllOpenSdgPlugins
269
290
  available_goals[language].push(available_goal)
270
291
  end
271
292
  # Set the target for this language, once only.
272
- if already_added[language].index(target_number) == nil
293
+ if !is_standalone && already_added[language].index(target_number) == nil
273
294
  already_added[language].push(target_number)
274
295
  available_target = {
275
296
  'number' => target_number,
@@ -293,12 +314,21 @@ module JekyllOpenSdgPlugins
293
314
  else
294
315
  indicator_name = meta['indicator_name']
295
316
  end
317
+ indicator_path = indicator_number
318
+ if is_standalone && meta.has_key?('permalink') && meta['permalink'] != ''
319
+ indicator_path = meta['permalink']
320
+ end
321
+ indicator_sort = get_sort_order(indicator_number)
322
+ if meta.has_key?('sort') && meta['sort'] != ''
323
+ # Allow metadata 'sort' field to override the default sort.
324
+ indicator_sort = meta['sort']
325
+ end
296
326
  available_indicator = {
297
327
  'number' => indicator_number,
298
328
  'slug' => indicator_number.gsub('.', '-'),
299
329
  'name' => opensdg_translate_key(indicator_name, translations, language),
300
- 'url' => get_url(baseurl, language, indicator_number, languages, languages_public),
301
- 'sort' => get_sort_order(indicator_number),
330
+ 'url' => get_url(baseurl, language, indicator_path, languages, languages_public),
331
+ 'sort' => indicator_sort,
302
332
  'goal_number' => goal_number,
303
333
  'target_number' => target_number,
304
334
  'global' => global_indicator,
@@ -374,7 +404,11 @@ module JekyllOpenSdgPlugins
374
404
  target_number = get_target_number(indicator_number)
375
405
  doc.data['goal'] = available_goals[language].find {|x| x['number'] == goal_number}
376
406
  doc.data['target'] = available_targets[language].find {|x| x['number'] == target_number}
377
- doc.data['indicator'] = available_indicators[language].find {|x| x['number'] == indicator_number}
407
+ indicator_index = available_indicators[language].find_index {|x| x['number'] == indicator_number}
408
+ doc.data['indicator'] = available_indicators[language][indicator_index]
409
+ doc.data['next'] = get_next_item(available_indicators[language], indicator_index)
410
+ doc.data['previous'] = get_previous_item(available_indicators[language], indicator_index)
411
+
378
412
  elsif collection == 'goals'
379
413
  # For goals we also set the current goal.
380
414
  if doc.data.has_key? 'goal_number'
@@ -389,7 +423,10 @@ module JekyllOpenSdgPlugins
389
423
  if goal_number.is_a? Numeric
390
424
  goal_number = goal_number.to_s
391
425
  end
392
- doc.data['goal'] = available_goals[language].find {|x| x['number'] == goal_number}
426
+ goal_index = available_goals[language].find_index {|x| x['number'] == goal_number}
427
+ doc.data['goal'] = available_goals[language][goal_index]
428
+ doc.data['next'] = get_next_item(available_goals[language], goal_index)
429
+ doc.data['previous'] = get_previous_item(available_goals[language], goal_index)
393
430
  end
394
431
  end
395
432
  end
@@ -1,3 +1,3 @@
1
1
  module JekyllOpenSdgPlugins
2
- VERSION = "1.2.0-beta5".freeze
2
+ VERSION = "1.3.1".freeze
3
3
  end
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: 1.2.0.pre.beta5
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brock Fanning
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-12-04 00:00:00.000000000 Z
11
+ date: 2021-03-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll
@@ -100,9 +100,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
100
100
  version: '0'
101
101
  required_rubygems_version: !ruby/object:Gem::Requirement
102
102
  requirements:
103
- - - ">"
103
+ - - ">="
104
104
  - !ruby/object:Gem::Version
105
- version: 1.3.1
105
+ version: '0'
106
106
  requirements: []
107
107
  rubygems_version: 3.1.4
108
108
  signing_key: