jekyll-open-sdg-plugins 1.2.0.pre.beta1 → 1.2.0.pre.beta6
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 +10 -5
- data/lib/jekyll-open-sdg-plugins/create_indicators.rb +30 -31
- data/lib/jekyll-open-sdg-plugins/create_pages.rb +10 -8
- data/lib/jekyll-open-sdg-plugins/schema-indicator-config.json +42 -33
- data/lib/jekyll-open-sdg-plugins/schema-site-config.json +161 -108
- data/lib/jekyll-open-sdg-plugins/sdg_variables.rb +1 -1
- data/lib/jekyll-open-sdg-plugins/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 175c1098b80cdde83f1b14cf976f2c5a14d4ef5605bd5970712276c5ac4e0098
|
4
|
+
data.tar.gz: 053f7aae3bc5b4b1a0c1ffbb51ffab2029e1058d62e40fda80567b2ac522279d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 47644a62f2244696045fb915262421fcf0f83b2ade9ee37824f76a172ad2851f68513ee00e92495334c0d2ffa1f43aa54deb95ebabfeeb58f923806670624fd5
|
7
|
+
data.tar.gz: fb4aee69cf0c348d0d08af195dace95571444d72394ba7259c6078583387361665f8d472160a3695e79ccc341b534faabde0943c08afd2d7f117c4b1e098cecc
|
@@ -8,7 +8,7 @@ module JekyllOpenSdgPlugins
|
|
8
8
|
|
9
9
|
def generate(site)
|
10
10
|
# If site.create_goals is set, create goals per the metadata.
|
11
|
-
if site.config['languages'] and site.config['create_goals']
|
11
|
+
if site.config['languages'] and site.config['create_goals'] and site.config['create_goals'].key?('layout') and site.config['create_goals']['layout'] != ''
|
12
12
|
# Compile the list of goals.
|
13
13
|
goals = {}
|
14
14
|
# Are we using translated builds?
|
@@ -27,10 +27,7 @@ module JekyllOpenSdgPlugins
|
|
27
27
|
goals[goal] = true
|
28
28
|
end
|
29
29
|
# Decide what layout to use for the goal pages.
|
30
|
-
layout = '
|
31
|
-
if site.config['create_goals'].key?('layout')
|
32
|
-
layout = site.config['create_goals']['layout']
|
33
|
-
end
|
30
|
+
layout = site.config['create_goals']['layout']
|
34
31
|
# See if we need to "map" any language codes.
|
35
32
|
languages_public = Hash.new
|
36
33
|
if site.config['languages_public']
|
@@ -63,6 +60,14 @@ module JekyllOpenSdgPlugins
|
|
63
60
|
@dir = dir
|
64
61
|
@name = 'index.html'
|
65
62
|
|
63
|
+
goal_content = ''
|
64
|
+
if site.config['create_goals'].has_key?('goals')
|
65
|
+
if !site.config['create_goals']['goals'][goal - 1].nil?
|
66
|
+
goal_content = site.config['create_goals']['goals'][goal - 1]['content']
|
67
|
+
end
|
68
|
+
end
|
69
|
+
@content = goal_content
|
70
|
+
|
66
71
|
self.process(@name)
|
67
72
|
self.data = {}
|
68
73
|
self.data['goal_number'] = goal.to_s
|
@@ -8,12 +8,9 @@ module JekyllOpenSdgPlugins
|
|
8
8
|
|
9
9
|
def generate(site)
|
10
10
|
# If site.create_indicators is set, create indicators per the metadata.
|
11
|
-
if site.config['languages'] and site.config['create_indicators']
|
11
|
+
if site.config['languages'] and site.config['create_indicators'] and site.config['create_indicators'].key?('layout') and site.config['create_indicators']['layout'] != ''
|
12
12
|
# Decide what layout to use for the indicator pages.
|
13
|
-
layout = '
|
14
|
-
if site.config['create_indicators'].key?('layout')
|
15
|
-
layout = site.config['create_indicators']['layout']
|
16
|
-
end
|
13
|
+
layout = site.config['create_indicators']['layout']
|
17
14
|
# See if we need to "map" any language codes.
|
18
15
|
languages_public = Hash.new
|
19
16
|
if site.config['languages_public']
|
@@ -44,33 +41,35 @@ module JekyllOpenSdgPlugins
|
|
44
41
|
end
|
45
42
|
end
|
46
43
|
# Create the indicator configuration pages.
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
44
|
+
if site.config['create_config_forms'] && site.config['create_config_forms'].key?('layout') && site.config['create_config_forms']['layout'] != ''
|
45
|
+
metadata = {}
|
46
|
+
layout = site.config['create_config_forms']['layout']
|
47
|
+
if opensdg_translated_builds(site)
|
48
|
+
if site.data.has_key?('untranslated')
|
49
|
+
metadata = site.data['untranslated']['meta']
|
50
|
+
else
|
51
|
+
default_language = site.config['languages'][0]
|
52
|
+
metadata = site.data[default_language]['meta']
|
53
|
+
end
|
51
54
|
else
|
52
|
-
|
53
|
-
metadata = site.data[default_language]['meta']
|
55
|
+
metadata = site.data['meta']
|
54
56
|
end
|
55
|
-
|
56
|
-
metadata
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
if index != 0
|
71
|
-
dir = File.join(language_public, 'config', inid)
|
57
|
+
# Loop through the indicators (using metadata as a list).
|
58
|
+
if !metadata.empty?
|
59
|
+
# Loop through the languages.
|
60
|
+
site.config['languages'].each_with_index do |language, index|
|
61
|
+
# Get the "public language" (for URLs) which may be different.
|
62
|
+
language_public = language
|
63
|
+
if languages_public[language]
|
64
|
+
language_public = languages_public[language]
|
65
|
+
end
|
66
|
+
metadata.each do |inid, meta|
|
67
|
+
dir = File.join('config', inid)
|
68
|
+
if index != 0
|
69
|
+
dir = File.join(language_public, 'config', inid)
|
70
|
+
end
|
71
|
+
site.collections['pages'].docs << IndicatorConfigPage.new(site, site.source, dir, inid, language, meta, layout)
|
72
72
|
end
|
73
|
-
site.collections['pages'].docs << IndicatorConfigPage.new(site, site.source, dir, inid, language, meta)
|
74
73
|
end
|
75
74
|
end
|
76
75
|
end
|
@@ -98,7 +97,7 @@ module JekyllOpenSdgPlugins
|
|
98
97
|
|
99
98
|
# A Page subclass used in the `CreateIndicators` class.
|
100
99
|
class IndicatorConfigPage < Jekyll::Page
|
101
|
-
def initialize(site, base, dir, inid, language, meta)
|
100
|
+
def initialize(site, base, dir, inid, language, meta, layout)
|
102
101
|
@site = site
|
103
102
|
@base = base
|
104
103
|
@dir = dir
|
@@ -109,7 +108,7 @@ module JekyllOpenSdgPlugins
|
|
109
108
|
self.data['language'] = language
|
110
109
|
self.data['indicator_number'] = inid.gsub('-', '.')
|
111
110
|
self.data['config_type'] = 'indicator'
|
112
|
-
self.data['layout'] =
|
111
|
+
self.data['layout'] = layout
|
113
112
|
self.data['meta'] = meta
|
114
113
|
self.data['title'] = 'Open SDG indicator configuration: ' + self.data['indicator_number']
|
115
114
|
self.data['config_filename'] = inid + '.yml'
|
@@ -67,13 +67,15 @@ module JekyllOpenSdgPlugins
|
|
67
67
|
# Hardcode the site configuration page if it's not already there.
|
68
68
|
config_page = pages.find { |page| page['layout'] == 'config-builder' }
|
69
69
|
if config_page == nil
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
70
|
+
if site.config['create_config_forms'] && site.config['create_config_forms'].key?('layout') && site.config['create_config_forms']['layout'] != ''
|
71
|
+
pages.push({
|
72
|
+
'folder' => '/config',
|
73
|
+
'layout' => site.config['create_config_forms']['layout'],
|
74
|
+
'title' => 'Open SDG site configuration',
|
75
|
+
'config_type' => 'site',
|
76
|
+
'config_filename' => 'site_config.yml'
|
77
|
+
})
|
78
|
+
end
|
77
79
|
end
|
78
80
|
|
79
81
|
# See if we need to "map" any language codes.
|
@@ -107,7 +109,7 @@ module JekyllOpenSdgPlugins
|
|
107
109
|
@site = site
|
108
110
|
@base = base
|
109
111
|
|
110
|
-
index_files = (!page.key?('filename') or page['filename'] == 'index.html')
|
112
|
+
index_files = (!page.key?('filename') or page['filename'] == 'index.html' or page['filename'] == '')
|
111
113
|
@dir = index_files ? File.join(dir, '/') : dir
|
112
114
|
@name = index_files ? 'index.html' : page['filename']
|
113
115
|
|
@@ -9,7 +9,7 @@
|
|
9
9
|
"description": "Unit of measurement which displays below the indicator chart.",
|
10
10
|
"links": [
|
11
11
|
{
|
12
|
-
"rel": "More information",
|
12
|
+
"rel": "More information on the units of measurement setting",
|
13
13
|
"href": "https://open-sdg.readthedocs.io/en/latest/metadata-format/#recommended-special-fields"
|
14
14
|
}
|
15
15
|
]
|
@@ -20,7 +20,7 @@
|
|
20
20
|
"description": "Copyright which displays below the indicator chart.",
|
21
21
|
"links": [
|
22
22
|
{
|
23
|
-
"rel": "More information",
|
23
|
+
"rel": "More information on the copyright setting",
|
24
24
|
"href": "https://open-sdg.readthedocs.io/en/latest/metadata-format/#footer"
|
25
25
|
}
|
26
26
|
]
|
@@ -32,7 +32,7 @@
|
|
32
32
|
"description": "Footnote which displays below the indicator chart.",
|
33
33
|
"links": [
|
34
34
|
{
|
35
|
-
"rel": "More information",
|
35
|
+
"rel": "More information on the footnote setting",
|
36
36
|
"href": "https://open-sdg.readthedocs.io/en/latest/metadata-format/#footer"
|
37
37
|
}
|
38
38
|
]
|
@@ -44,7 +44,7 @@
|
|
44
44
|
"format": "checkbox",
|
45
45
|
"links": [
|
46
46
|
{
|
47
|
-
"rel": "More information",
|
47
|
+
"rel": "More information the non-statistical setting",
|
48
48
|
"href": "https://open-sdg.readthedocs.io/en/latest/metadata-format/#mandatory-fields"
|
49
49
|
}
|
50
50
|
]
|
@@ -55,7 +55,7 @@
|
|
55
55
|
"description": "A CSS class to apply to the data notice for this indicator.",
|
56
56
|
"links": [
|
57
57
|
{
|
58
|
-
"rel": "More information",
|
58
|
+
"rel": "More information on the data notice setting",
|
59
59
|
"href": "https://open-sdg.readthedocs.io/en/latest/metadata-format/#data-notice"
|
60
60
|
}
|
61
61
|
]
|
@@ -66,7 +66,7 @@
|
|
66
66
|
"description": "A title to display above the data notice for this indicator.",
|
67
67
|
"links": [
|
68
68
|
{
|
69
|
-
"rel": "More information",
|
69
|
+
"rel": "More information on the data notice heading setting",
|
70
70
|
"href": "https://open-sdg.readthedocs.io/en/latest/metadata-format/#data-notice"
|
71
71
|
}
|
72
72
|
]
|
@@ -78,7 +78,7 @@
|
|
78
78
|
"description": "Text to display as a data notice for this indicator, intended to contain very important information which site viewers must keep in mind when using the data provided.",
|
79
79
|
"links": [
|
80
80
|
{
|
81
|
-
"rel": "More information",
|
81
|
+
"rel": "More information on the data notice text setting",
|
82
82
|
"href": "https://open-sdg.readthedocs.io/en/latest/metadata-format/#data-notice"
|
83
83
|
}
|
84
84
|
]
|
@@ -90,14 +90,13 @@
|
|
90
90
|
"format": "checkbox",
|
91
91
|
"links": [
|
92
92
|
{
|
93
|
-
"rel": "More information",
|
93
|
+
"rel": "More information on the map setting",
|
94
94
|
"href": "https://open-sdg.readthedocs.io/en/latest/maps/#metadata-field-data_show_map"
|
95
95
|
}
|
96
96
|
]
|
97
97
|
},
|
98
98
|
"data_start_values": {
|
99
99
|
"options": {"collapsed": true},
|
100
|
-
"format": "table",
|
101
100
|
"type": "array",
|
102
101
|
"title": "Starting values",
|
103
102
|
"description": "Disaggregation values for a an indicator to start with already selected",
|
@@ -121,7 +120,7 @@
|
|
121
120
|
},
|
122
121
|
"links": [
|
123
122
|
{
|
124
|
-
"rel": "More information",
|
123
|
+
"rel": "More information on the starting values setting",
|
125
124
|
"href": "https://open-sdg.readthedocs.io/en/latest/metadata-format/#starting-values"
|
126
125
|
}
|
127
126
|
]
|
@@ -133,7 +132,7 @@
|
|
133
132
|
"description": "A footer that displays below the embedded feature. Only used with either embedded_feature_url or embedded_feature_html.",
|
134
133
|
"links": [
|
135
134
|
{
|
136
|
-
"rel": "More information",
|
135
|
+
"rel": "More information on the embed footer setting",
|
137
136
|
"href": "https://open-sdg.readthedocs.io/en/latest/metadata-format/#embedded-feature-metadata"
|
138
137
|
}
|
139
138
|
]
|
@@ -145,7 +144,7 @@
|
|
145
144
|
"description": "Any HTML to display in another tab, after Chart/Table/etc.",
|
146
145
|
"links": [
|
147
146
|
{
|
148
|
-
"rel": "More information",
|
147
|
+
"rel": "More information on the embed HTML setting",
|
149
148
|
"href": "https://open-sdg.readthedocs.io/en/latest/metadata-format/#embedded-feature-metadata"
|
150
149
|
}
|
151
150
|
]
|
@@ -156,7 +155,7 @@
|
|
156
155
|
"description": "A title for the embedded feature tab (ie, Chart/Table/[this]). Only used with either embedded_feature_url or embedded_feature_html.",
|
157
156
|
"links": [
|
158
157
|
{
|
159
|
-
"rel": "More information",
|
158
|
+
"rel": "More information on the embed tab title setting",
|
160
159
|
"href": "https://open-sdg.readthedocs.io/en/latest/metadata-format/#embedded-feature-metadata"
|
161
160
|
}
|
162
161
|
]
|
@@ -167,7 +166,7 @@
|
|
167
166
|
"description": "A title that displays above the embedded feature. Only used with either embedded_feature_url or embedded_feature_html.",
|
168
167
|
"links": [
|
169
168
|
{
|
170
|
-
"rel": "More information",
|
169
|
+
"rel": "More information on the embed title setting",
|
171
170
|
"href": "https://open-sdg.readthedocs.io/en/latest/metadata-format/#embedded-feature-metadata"
|
172
171
|
}
|
173
172
|
]
|
@@ -179,11 +178,27 @@
|
|
179
178
|
"description": "Any URL to display as an iframe in another tab, after Chart/Table/etc.",
|
180
179
|
"links": [
|
181
180
|
{
|
182
|
-
"rel": "More information",
|
181
|
+
"rel": "More information on the embed URL setting",
|
183
182
|
"href": "https://open-sdg.readthedocs.io/en/latest/metadata-format/#embedded-feature-metadata"
|
184
183
|
}
|
185
184
|
]
|
186
185
|
},
|
186
|
+
"expected_disaggregations": {
|
187
|
+
"options": {"collapsed": true},
|
188
|
+
"type": "array",
|
189
|
+
"title": "Expected disaggregations",
|
190
|
+
"description": "An optional list of disaggregations (ie, data column names) to use when calculating the disaggregation status statistics.",
|
191
|
+
"items": {
|
192
|
+
"type": "string",
|
193
|
+
"title": "Expected disaggregation"
|
194
|
+
},
|
195
|
+
"links": [
|
196
|
+
{
|
197
|
+
"rel": "More information on the expected disaggregation setting",
|
198
|
+
"href": "https://open-sdg.readthedocs.io/en/latest/metadata-format/#recommended-special-fields"
|
199
|
+
}
|
200
|
+
]
|
201
|
+
},
|
187
202
|
"graph_annotations": {
|
188
203
|
"options": {"collapsed": true},
|
189
204
|
"type": "array",
|
@@ -195,7 +210,6 @@
|
|
195
210
|
"properties": {
|
196
211
|
"preset": {
|
197
212
|
"type": "string",
|
198
|
-
"format": "choices",
|
199
213
|
"title": "Preset",
|
200
214
|
"enum": ["target_line"],
|
201
215
|
"description": "A preset bundle of configurations."
|
@@ -239,7 +253,7 @@
|
|
239
253
|
"description": "The color of the line.",
|
240
254
|
"links": [
|
241
255
|
{
|
242
|
-
"rel": "More information",
|
256
|
+
"rel": "More information on the border color setting",
|
243
257
|
"href": "https://github.com/chartjs/chartjs-plugin-annotation/blob/master/README.md"
|
244
258
|
}
|
245
259
|
]
|
@@ -250,7 +264,7 @@
|
|
250
264
|
"description": "The type of line dash.",
|
251
265
|
"links": [
|
252
266
|
{
|
253
|
-
"rel": "More information",
|
267
|
+
"rel": "More information on the line dash setting",
|
254
268
|
"href": "https://github.com/chartjs/chartjs-plugin-annotation/blob/master/README.md"
|
255
269
|
}
|
256
270
|
]
|
@@ -332,14 +346,13 @@
|
|
332
346
|
},
|
333
347
|
"links": [
|
334
348
|
{
|
335
|
-
"rel": "More information",
|
349
|
+
"rel": "More information on the graph annotations setting",
|
336
350
|
"href": "https://open-sdg.readthedocs.io/en/latest/metadata-format/#graph-metadata"
|
337
351
|
}
|
338
352
|
]
|
339
353
|
},
|
340
354
|
"graph_limits": {
|
341
355
|
"options": {"collapsed": true},
|
342
|
-
"format": "table",
|
343
356
|
"type": "array",
|
344
357
|
"title": "Graph limits",
|
345
358
|
"description": "A list of min/max limits controlling the lowest/highest values to be shown on the y-axis.",
|
@@ -373,7 +386,7 @@
|
|
373
386
|
},
|
374
387
|
"links": [
|
375
388
|
{
|
376
|
-
"rel": "More information",
|
389
|
+
"rel": "More information on the graph limits setting",
|
377
390
|
"href": "https://open-sdg.readthedocs.io/en/latest/metadata-format/#graph-metadata"
|
378
391
|
}
|
379
392
|
]
|
@@ -384,7 +397,7 @@
|
|
384
397
|
"description": "This can be used with the bar graph type to place a certain disaggregation into the same stacked bars.",
|
385
398
|
"links": [
|
386
399
|
{
|
387
|
-
"rel": "More information",
|
400
|
+
"rel": "More information on the stacked disaggregation setting",
|
388
401
|
"href": "https://open-sdg.readthedocs.io/en/latest/metadata-format/#recommended-special-fields"
|
389
402
|
}
|
390
403
|
]
|
@@ -395,14 +408,13 @@
|
|
395
408
|
"description": "The title that displays above the graph/chart.",
|
396
409
|
"links": [
|
397
410
|
{
|
398
|
-
"rel": "More information",
|
411
|
+
"rel": "More information on the graph title setting",
|
399
412
|
"href": "https://open-sdg.readthedocs.io/en/latest/metadata-format/#mandatory-for-statistical-indicators"
|
400
413
|
}
|
401
414
|
]
|
402
415
|
},
|
403
416
|
"graph_titles": {
|
404
417
|
"options": {"collapsed": true},
|
405
|
-
"format": "table",
|
406
418
|
"type": "array",
|
407
419
|
"title": "Graph titles",
|
408
420
|
"description": "As an alternative to `graph_title`, this can be used to set specific titles for particular units and/or series.",
|
@@ -431,13 +443,12 @@
|
|
431
443
|
},
|
432
444
|
"graph_type": {
|
433
445
|
"type": "string",
|
434
|
-
"format": "choices",
|
435
446
|
"title": "Graph type",
|
436
447
|
"description": "What type of graph to use for the indicator.",
|
437
448
|
"enum": ["line", "bar", "binary"],
|
438
449
|
"links": [
|
439
450
|
{
|
440
|
-
"rel": "More information",
|
451
|
+
"rel": "More information on the graph titles setting",
|
441
452
|
"href": "https://open-sdg.readthedocs.io/en/latest/metadata-format/#mandatory-for-statistical-indicators"
|
442
453
|
}
|
443
454
|
]
|
@@ -448,7 +459,7 @@
|
|
448
459
|
"description": "The name for the indicator, which displays at the top of the indicator page.",
|
449
460
|
"links": [
|
450
461
|
{
|
451
|
-
"rel": "More information",
|
462
|
+
"rel": "More information on the indicator name setting",
|
452
463
|
"href": "https://open-sdg.readthedocs.io/en/latest/metadata-format/#mandatory-fields"
|
453
464
|
}
|
454
465
|
]
|
@@ -459,7 +470,7 @@
|
|
459
470
|
"description": "The number (or 'id') for the indicator.",
|
460
471
|
"links": [
|
461
472
|
{
|
462
|
-
"rel": "More information",
|
473
|
+
"rel": "More information on the indicator number setting",
|
463
474
|
"href": "https://open-sdg.readthedocs.io/en/latest/metadata-format/#mandatory-fields"
|
464
475
|
}
|
465
476
|
]
|
@@ -470,7 +481,7 @@
|
|
470
481
|
"description": "A label used in the absence of any disaggregation.",
|
471
482
|
"links": [
|
472
483
|
{
|
473
|
-
"rel": "More information",
|
484
|
+
"rel": "More information on the geographical coverage setting",
|
474
485
|
"href": "https://open-sdg.readthedocs.io/en/latest/metadata-format/#mandatory-for-statistical-indicators"
|
475
486
|
}
|
476
487
|
]
|
@@ -483,20 +494,18 @@
|
|
483
494
|
},
|
484
495
|
"reporting_status": {
|
485
496
|
"type": "string",
|
486
|
-
"format": "choices",
|
487
497
|
"title": "Reporting status",
|
488
498
|
"enum": ["complete", "inprogress", "notstarted", "notapplicable"],
|
489
499
|
"description": "The status of the indicator.",
|
490
500
|
"links": [
|
491
501
|
{
|
492
|
-
"rel": "More information",
|
502
|
+
"rel": "More information on the reporting status setting",
|
493
503
|
"href": "https://open-sdg.readthedocs.io/en/latest/metadata-format/#mandatory-fields"
|
494
504
|
}
|
495
505
|
]
|
496
506
|
},
|
497
507
|
"tags": {
|
498
508
|
"options": {"collapsed": true},
|
499
|
-
"format": "table",
|
500
509
|
"type": "array",
|
501
510
|
"title": "Tags",
|
502
511
|
"description": "An optional list of 'tags' to display under an indicator when it is listed on its goal page.",
|
@@ -506,7 +515,7 @@
|
|
506
515
|
},
|
507
516
|
"links": [
|
508
517
|
{
|
509
|
-
"rel": "More information",
|
518
|
+
"rel": "More information on the tags setting",
|
510
519
|
"href": "https://open-sdg.readthedocs.io/en/latest/metadata-format/#recommended-special-fields"
|
511
520
|
}
|
512
521
|
]
|