jekyll-open-sdg-plugins 1.2.0.pre.beta4 → 1.3.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 +4 -4
- data/lib/jekyll-open-sdg-plugins/create_goals.rb +11 -0
- data/lib/jekyll-open-sdg-plugins/create_indicators.rb +12 -3
- data/lib/jekyll-open-sdg-plugins/create_pages.rb +1 -1
- data/lib/jekyll-open-sdg-plugins/schema-indicator-config.json +231 -156
- data/lib/jekyll-open-sdg-plugins/schema-site-config.json +169 -58
- data/lib/jekyll-open-sdg-plugins/sdg_variables.rb +44 -7
- data/lib/jekyll-open-sdg-plugins/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ee38bdf65103fdf29cdc1c5718b11ade6f0af536bbc2df47744b2d4864178adb
|
|
4
|
+
data.tar.gz: 45620f6186df1d77b8ec1b831ad178e9f038b3f07ac38ce627fe7a6590d096f3
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 33d1c39b8177fb409b3b094b0b0ca85c856087746d5538440fea445e98260f83bd55dd1052431b6b8d3886475f7f82c2637ae2ee0cec33aec4bd5545dfa35e36
|
|
7
|
+
data.tar.gz: 18543063111561aa2d5ba9c5ce2e73773e0b4c842c7067beecc0a8a5f7c9de5a2f618c9a4feb87fd7fcf6734d994aed74bcaaed9a858029d0f0bcd0998026726
|
|
@@ -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 ?
|
|
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
|
-
|
|
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',
|
|
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
|
|
@@ -109,7 +109,7 @@ module JekyllOpenSdgPlugins
|
|
|
109
109
|
@site = site
|
|
110
110
|
@base = base
|
|
111
111
|
|
|
112
|
-
index_files = (!page.key?('filename') or page['filename'] == 'index.html')
|
|
112
|
+
index_files = (!page.key?('filename') or page['filename'] == 'index.html' or page['filename'] == '')
|
|
113
113
|
@dir = index_files ? File.join(dir, '/') : dir
|
|
114
114
|
@name = index_files ? 'index.html' : page['filename']
|
|
115
115
|
|
|
@@ -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",
|
|
@@ -184,6 +194,22 @@
|
|
|
184
194
|
}
|
|
185
195
|
]
|
|
186
196
|
},
|
|
197
|
+
"expected_disaggregations": {
|
|
198
|
+
"options": {"collapsed": true},
|
|
199
|
+
"type": "array",
|
|
200
|
+
"title": "Expected disaggregations",
|
|
201
|
+
"description": "An optional list of disaggregations (ie, data column names) to use when calculating the disaggregation status statistics.",
|
|
202
|
+
"items": {
|
|
203
|
+
"type": "string",
|
|
204
|
+
"title": "Expected disaggregation"
|
|
205
|
+
},
|
|
206
|
+
"links": [
|
|
207
|
+
{
|
|
208
|
+
"rel": "More information on the expected disaggregation setting",
|
|
209
|
+
"href": "https://open-sdg.readthedocs.io/en/latest/metadata-format/#recommended-special-fields"
|
|
210
|
+
}
|
|
211
|
+
]
|
|
212
|
+
},
|
|
187
213
|
"graph_annotations": {
|
|
188
214
|
"options": {"collapsed": true},
|
|
189
215
|
"type": "array",
|
|
@@ -192,142 +218,131 @@
|
|
|
192
218
|
"items": {
|
|
193
219
|
"type": "object",
|
|
194
220
|
"title": "Graph annotation",
|
|
195
|
-
"
|
|
196
|
-
"
|
|
197
|
-
|
|
198
|
-
"title": "Preset",
|
|
199
|
-
"enum": ["target_line"],
|
|
200
|
-
"description": "A preset bundle of configurations."
|
|
201
|
-
},
|
|
202
|
-
"value": {
|
|
203
|
-
"type": "number",
|
|
204
|
-
"minimum": 0,
|
|
205
|
-
"title": "Value",
|
|
206
|
-
"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)."
|
|
207
|
-
},
|
|
208
|
-
"endValue": {
|
|
209
|
-
"type": "number",
|
|
210
|
-
"title": "End value",
|
|
211
|
-
"description": "Optionally add a different ending value for the line."
|
|
212
|
-
},
|
|
213
|
-
"description": {
|
|
214
|
-
"type": "string",
|
|
215
|
-
"title": "Description",
|
|
216
|
-
"description": "A description of the annotation to be read by screenreaders."
|
|
217
|
-
},
|
|
218
|
-
"unit": {
|
|
219
|
-
"type": "string",
|
|
220
|
-
"title": "Unit",
|
|
221
|
-
"description": "The unit of measurement the annotation displays on."
|
|
222
|
-
},
|
|
223
|
-
"series": {
|
|
224
|
-
"type": "string",
|
|
225
|
-
"title": "Series",
|
|
226
|
-
"description": "The series the annotation displays on."
|
|
227
|
-
},
|
|
228
|
-
"mode": {
|
|
229
|
-
"type": "string",
|
|
230
|
-
"title": "Mode",
|
|
231
|
-
"description": "Whether the line will be vertical or horizontal.",
|
|
232
|
-
"enum": ["horizontal", "vertical"]
|
|
233
|
-
},
|
|
234
|
-
"borderColor": {
|
|
235
|
-
"type": "string",
|
|
236
|
-
"format": "color",
|
|
237
|
-
"title": "Line color",
|
|
238
|
-
"description": "The color of the line.",
|
|
239
|
-
"links": [
|
|
240
|
-
{
|
|
241
|
-
"rel": "More information on the border color setting",
|
|
242
|
-
"href": "https://github.com/chartjs/chartjs-plugin-annotation/blob/master/README.md"
|
|
243
|
-
}
|
|
244
|
-
]
|
|
245
|
-
},
|
|
246
|
-
"borderDash": {
|
|
247
|
-
"type": "string",
|
|
248
|
-
"title": "Line dash type",
|
|
249
|
-
"description": "The type of line dash.",
|
|
250
|
-
"links": [
|
|
251
|
-
{
|
|
252
|
-
"rel": "More information on the line dash setting",
|
|
253
|
-
"href": "https://github.com/chartjs/chartjs-plugin-annotation/blob/master/README.md"
|
|
254
|
-
}
|
|
255
|
-
]
|
|
256
|
-
},
|
|
257
|
-
"label": {
|
|
258
|
-
"type": "object",
|
|
259
|
-
"title": "Label",
|
|
260
|
-
"description": "A text label for the annotation.",
|
|
221
|
+
"allOf": [
|
|
222
|
+
{ "$ref": "#/definitions/series_unit_constraint" },
|
|
223
|
+
{
|
|
261
224
|
"properties": {
|
|
262
|
-
"
|
|
263
|
-
"type": "
|
|
264
|
-
"
|
|
265
|
-
"
|
|
266
|
-
"
|
|
267
|
-
"top",
|
|
268
|
-
"bottom",
|
|
269
|
-
"left",
|
|
270
|
-
"right",
|
|
271
|
-
"center"
|
|
272
|
-
]
|
|
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)."
|
|
273
230
|
},
|
|
274
|
-
"
|
|
275
|
-
"type": "
|
|
276
|
-
"
|
|
277
|
-
"
|
|
278
|
-
"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."
|
|
279
235
|
},
|
|
280
|
-
"
|
|
236
|
+
"description": {
|
|
281
237
|
"type": "string",
|
|
282
|
-
"
|
|
283
|
-
"
|
|
284
|
-
"description": "Color for the label text."
|
|
238
|
+
"title": "Description",
|
|
239
|
+
"description": "A description of the annotation to be read by screenreaders."
|
|
285
240
|
},
|
|
286
|
-
"
|
|
241
|
+
"mode": {
|
|
287
242
|
"type": "string",
|
|
288
|
-
"
|
|
289
|
-
"
|
|
290
|
-
"
|
|
291
|
-
|
|
292
|
-
}
|
|
293
|
-
}
|
|
294
|
-
},
|
|
295
|
-
"highContrast": {
|
|
296
|
-
"type": "object",
|
|
297
|
-
"title": "High contrast options",
|
|
298
|
-
"description": "High-contrast overrides of certain color.",
|
|
299
|
-
"properties": {
|
|
243
|
+
"title": "Mode",
|
|
244
|
+
"description": "Whether the line will be vertical or horizontal.",
|
|
245
|
+
"enum": ["horizontal", "vertical"]
|
|
246
|
+
},
|
|
300
247
|
"borderColor": {
|
|
301
248
|
"type": "string",
|
|
302
249
|
"format": "color",
|
|
303
|
-
"
|
|
304
|
-
"
|
|
305
|
-
"
|
|
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
|
+
]
|
|
306
269
|
},
|
|
307
270
|
"label": {
|
|
308
271
|
"type": "object",
|
|
309
|
-
"title": "
|
|
310
|
-
"description": "
|
|
272
|
+
"title": "Label",
|
|
273
|
+
"description": "A text label for the annotation.",
|
|
311
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
|
+
},
|
|
312
293
|
"fontColor": {
|
|
313
294
|
"type": "string",
|
|
314
295
|
"format": "color",
|
|
315
|
-
"
|
|
316
|
-
"
|
|
317
|
-
"description": "Color for the label text in high-contrast mode."
|
|
296
|
+
"title": "Label color",
|
|
297
|
+
"description": "Color for the label text."
|
|
318
298
|
},
|
|
319
299
|
"backgroundColor": {
|
|
320
300
|
"type": "string",
|
|
321
301
|
"format": "color",
|
|
322
|
-
"default": "#
|
|
323
|
-
"title": "
|
|
324
|
-
"description": "Background color for the label text
|
|
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
|
+
}
|
|
325
340
|
}
|
|
326
341
|
}
|
|
327
342
|
}
|
|
328
343
|
}
|
|
329
344
|
}
|
|
330
|
-
|
|
345
|
+
]
|
|
331
346
|
},
|
|
332
347
|
"links": [
|
|
333
348
|
{
|
|
@@ -338,37 +353,31 @@
|
|
|
338
353
|
},
|
|
339
354
|
"graph_limits": {
|
|
340
355
|
"options": {"collapsed": true},
|
|
341
|
-
"format": "table",
|
|
342
356
|
"type": "array",
|
|
343
357
|
"title": "Graph limits",
|
|
344
358
|
"description": "A list of min/max limits controlling the lowest/highest values to be shown on the y-axis.",
|
|
345
359
|
"items": {
|
|
346
360
|
"type": "object",
|
|
347
361
|
"title": "Graph limit",
|
|
348
|
-
"
|
|
349
|
-
"
|
|
350
|
-
|
|
351
|
-
"
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
},
|
|
366
|
-
"series": {
|
|
367
|
-
"type": "string",
|
|
368
|
-
"title": "Series",
|
|
369
|
-
"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
|
+
}
|
|
370
379
|
}
|
|
371
|
-
|
|
380
|
+
]
|
|
372
381
|
},
|
|
373
382
|
"links": [
|
|
374
383
|
{
|
|
@@ -401,31 +410,25 @@
|
|
|
401
410
|
},
|
|
402
411
|
"graph_titles": {
|
|
403
412
|
"options": {"collapsed": true},
|
|
404
|
-
"format": "table",
|
|
405
413
|
"type": "array",
|
|
406
414
|
"title": "Graph titles",
|
|
407
415
|
"description": "As an alternative to `graph_title`, this can be used to set specific titles for particular units and/or series.",
|
|
408
416
|
"items": {
|
|
409
417
|
"type": "object",
|
|
410
418
|
"title": "Graph title",
|
|
411
|
-
"
|
|
412
|
-
"
|
|
413
|
-
|
|
414
|
-
"
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
},
|
|
423
|
-
"series": {
|
|
424
|
-
"type": "string",
|
|
425
|
-
"title": "Series",
|
|
426
|
-
"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
|
+
}
|
|
427
430
|
}
|
|
428
|
-
|
|
431
|
+
]
|
|
429
432
|
}
|
|
430
433
|
},
|
|
431
434
|
"graph_type": {
|
|
@@ -479,6 +482,39 @@
|
|
|
479
482
|
"title": "Page content",
|
|
480
483
|
"description": "Content which displays in the main content area of the indicator page."
|
|
481
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
|
+
},
|
|
482
518
|
"reporting_status": {
|
|
483
519
|
"type": "string",
|
|
484
520
|
"title": "Reporting status",
|
|
@@ -491,9 +527,31 @@
|
|
|
491
527
|
}
|
|
492
528
|
]
|
|
493
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
|
+
},
|
|
494
553
|
"tags": {
|
|
495
554
|
"options": {"collapsed": true},
|
|
496
|
-
"format": "table",
|
|
497
555
|
"type": "array",
|
|
498
556
|
"title": "Tags",
|
|
499
557
|
"description": "An optional list of 'tags' to display under an indicator when it is listed on its goal page.",
|
|
@@ -509,5 +567,22 @@
|
|
|
509
567
|
]
|
|
510
568
|
}
|
|
511
569
|
},
|
|
512
|
-
"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
|
+
}
|
|
513
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.",
|
|
@@ -739,41 +836,18 @@
|
|
|
739
836
|
"type": "object",
|
|
740
837
|
"title": "Map options",
|
|
741
838
|
"description": "Site-wide configuration of map behavior and style.",
|
|
742
|
-
"default": {
|
|
743
|
-
"minZoom": 5,
|
|
744
|
-
"maxZoom": 10,
|
|
745
|
-
"colorRange": "chroma.brewer.BuGn",
|
|
746
|
-
"noValueColor": "#f0f0f0",
|
|
747
|
-
"styleNormal": {
|
|
748
|
-
"weight": 1,
|
|
749
|
-
"opacity": 1,
|
|
750
|
-
"fillOpacity": 0.7,
|
|
751
|
-
"color": "#888888"
|
|
752
|
-
},
|
|
753
|
-
"styleHighlighted": {
|
|
754
|
-
"weight": 1,
|
|
755
|
-
"opacity": 1,
|
|
756
|
-
"fillOpacity": 0.7,
|
|
757
|
-
"color": "#111111"
|
|
758
|
-
},
|
|
759
|
-
"styleStatic": {
|
|
760
|
-
"weight": 2,
|
|
761
|
-
"opacity": 1,
|
|
762
|
-
"fillOpacity": 0,
|
|
763
|
-
"color": "#172d44",
|
|
764
|
-
"dashArray": "5,5"
|
|
765
|
-
}
|
|
766
|
-
},
|
|
767
839
|
"properties": {
|
|
768
840
|
"minZoom": {
|
|
769
841
|
"title": "Minimum zoom",
|
|
770
842
|
"type": "integer",
|
|
771
|
-
"description": "The lowest amount of 'zoom' possible for users."
|
|
843
|
+
"description": "The lowest amount of 'zoom' possible for users.",
|
|
844
|
+
"default": 5
|
|
772
845
|
},
|
|
773
846
|
"maxZoom": {
|
|
774
847
|
"title": "Maximum zoom",
|
|
775
848
|
"type": "integer",
|
|
776
|
-
"description": "The highest amount of 'zoom' possible for users."
|
|
849
|
+
"description": "The highest amount of 'zoom' possible for users.",
|
|
850
|
+
"default": 10
|
|
777
851
|
},
|
|
778
852
|
"tileURL": {
|
|
779
853
|
"title": "Tile URL",
|
|
@@ -805,6 +879,7 @@
|
|
|
805
879
|
"type": "string",
|
|
806
880
|
"title": "Color range",
|
|
807
881
|
"description": "The color range for the choropleth map.",
|
|
882
|
+
"default": "chroma.brewer.BuGn",
|
|
808
883
|
"links": [
|
|
809
884
|
{
|
|
810
885
|
"ref": "More information on the color range setting",
|
|
@@ -816,28 +891,45 @@
|
|
|
816
891
|
"type": "string",
|
|
817
892
|
"format": "color",
|
|
818
893
|
"title": "No-value color",
|
|
819
|
-
"description": "Color for boundaries that have no data."
|
|
894
|
+
"description": "Color for boundaries that have no data.",
|
|
895
|
+
"default": "#f0f0f0"
|
|
820
896
|
},
|
|
821
897
|
"styleNormal": {
|
|
822
898
|
"type": "object",
|
|
823
|
-
"format": "table",
|
|
824
899
|
"title": "Style (normal)",
|
|
825
900
|
"description": "Style for boundaries in normal state",
|
|
826
|
-
"$ref": "#/definitions/map_style"
|
|
901
|
+
"$ref": "#/definitions/map_style",
|
|
902
|
+
"default": {
|
|
903
|
+
"weight": 1,
|
|
904
|
+
"opacity": 1,
|
|
905
|
+
"fillOpacity": 0.7,
|
|
906
|
+
"color": "#888888"
|
|
907
|
+
}
|
|
827
908
|
},
|
|
828
909
|
"styleHighlighted": {
|
|
829
910
|
"type": "object",
|
|
830
|
-
"format": "table",
|
|
831
911
|
"title": "Style (highlighted)",
|
|
832
912
|
"description": "Style for boundaries in highlighted state",
|
|
833
|
-
"$ref": "#/definitions/map_style"
|
|
913
|
+
"$ref": "#/definitions/map_style",
|
|
914
|
+
"default": {
|
|
915
|
+
"weight": 1,
|
|
916
|
+
"opacity": 1,
|
|
917
|
+
"fillOpacity": 0.7,
|
|
918
|
+
"color": "#111111"
|
|
919
|
+
}
|
|
834
920
|
},
|
|
835
921
|
"styleStatic": {
|
|
836
922
|
"type": "object",
|
|
837
|
-
"format": "table",
|
|
838
923
|
"title": "Style (static)",
|
|
839
924
|
"description": "Style for boundaries in static state (map layers using the 'static boundaries' option).",
|
|
840
|
-
"$ref": "#/definitions/map_style"
|
|
925
|
+
"$ref": "#/definitions/map_style",
|
|
926
|
+
"default": {
|
|
927
|
+
"weight": 2,
|
|
928
|
+
"opacity": 1,
|
|
929
|
+
"fillOpacity": 0,
|
|
930
|
+
"color": "#172d44",
|
|
931
|
+
"dashArray": "5,5"
|
|
932
|
+
}
|
|
841
933
|
}
|
|
842
934
|
},
|
|
843
935
|
"links": [
|
|
@@ -849,13 +941,28 @@
|
|
|
849
941
|
},
|
|
850
942
|
"menu": {
|
|
851
943
|
"options": {"collapsed": true},
|
|
852
|
-
"format": "table",
|
|
853
944
|
"type": "array",
|
|
854
945
|
"minItems": 1,
|
|
855
946
|
"title": "Main menu",
|
|
856
947
|
"description": "The links to display in the main menu.",
|
|
857
948
|
"items": {
|
|
858
|
-
"
|
|
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
|
+
]
|
|
859
966
|
},
|
|
860
967
|
"links": [
|
|
861
968
|
{
|
|
@@ -878,7 +985,6 @@
|
|
|
878
985
|
},
|
|
879
986
|
"metadata_tabs": {
|
|
880
987
|
"options": {"collapsed": true},
|
|
881
|
-
"format": "table",
|
|
882
988
|
"type": "array",
|
|
883
989
|
"title": "Metadata tabs",
|
|
884
990
|
"description": "This setting can control the metadata tabs which appear on the indicator pages.",
|
|
@@ -961,7 +1067,19 @@
|
|
|
961
1067
|
"type": "object",
|
|
962
1068
|
"title": "Reporting status",
|
|
963
1069
|
"description": "This setting is used in the 'reportingstatus' layout. It can display a title and description above the reporting status page.",
|
|
964
|
-
"
|
|
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
|
+
],
|
|
965
1083
|
"links": [
|
|
966
1084
|
{
|
|
967
1085
|
"rel": "More information on the reporting status setting",
|
|
@@ -971,7 +1089,6 @@
|
|
|
971
1089
|
},
|
|
972
1090
|
"search_index_boost": {
|
|
973
1091
|
"options": {"collapsed": true},
|
|
974
|
-
"format": "table",
|
|
975
1092
|
"type": "array",
|
|
976
1093
|
"title": "Search index boost",
|
|
977
1094
|
"description": "This setting can be used to give a boost to one or more fields in the search index.",
|
|
@@ -1002,7 +1119,6 @@
|
|
|
1002
1119
|
},
|
|
1003
1120
|
"search_index_extra_fields": {
|
|
1004
1121
|
"options": {"collapsed": true},
|
|
1005
|
-
"format": "table",
|
|
1006
1122
|
"type": "array",
|
|
1007
1123
|
"title": "Search index extra fields",
|
|
1008
1124
|
"description": "This setting can be used to index additional metadata fields in your indicators, for the purposes of affecting the site-wide search.",
|
|
@@ -1115,12 +1231,10 @@
|
|
|
1115
1231
|
"properties": {
|
|
1116
1232
|
"title": {
|
|
1117
1233
|
"type": "string",
|
|
1118
|
-
"minLength": 1,
|
|
1119
1234
|
"title": "Title"
|
|
1120
1235
|
},
|
|
1121
1236
|
"description": {
|
|
1122
1237
|
"type": "string",
|
|
1123
|
-
"minLength": 1,
|
|
1124
1238
|
"title": "Description",
|
|
1125
1239
|
"format": "markdown"
|
|
1126
1240
|
}
|
|
@@ -1165,7 +1279,6 @@
|
|
|
1165
1279
|
"description": "Set options for any dropdown lists.",
|
|
1166
1280
|
"items": {
|
|
1167
1281
|
"type": "object",
|
|
1168
|
-
"format": "table",
|
|
1169
1282
|
"title": "Dropdown list",
|
|
1170
1283
|
"properties": {
|
|
1171
1284
|
"jsonschema": {
|
|
@@ -1175,7 +1288,6 @@
|
|
|
1175
1288
|
},
|
|
1176
1289
|
"values": {
|
|
1177
1290
|
"type": "array",
|
|
1178
|
-
"format": "table",
|
|
1179
1291
|
"title": "Values",
|
|
1180
1292
|
"description": "List of dropdown option values",
|
|
1181
1293
|
"items": {
|
|
@@ -1185,7 +1297,6 @@
|
|
|
1185
1297
|
},
|
|
1186
1298
|
"labels": {
|
|
1187
1299
|
"type": "array",
|
|
1188
|
-
"format": "table",
|
|
1189
1300
|
"title": "Labels",
|
|
1190
1301
|
"description": "Optional list of dropdown option labels. Should correspond to the values above.",
|
|
1191
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,
|
|
301
|
-
'sort' =>
|
|
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
|
-
|
|
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
|
-
|
|
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
|
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.
|
|
4
|
+
version: 1.3.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Brock Fanning
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2021-03-12 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:
|
|
105
|
+
version: '0'
|
|
106
106
|
requirements: []
|
|
107
107
|
rubygems_version: 3.1.4
|
|
108
108
|
signing_key:
|