jekyll-open-sdg-plugins 0.0.14 → 0.0.15

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: f84c6856a8ed6914a54a966849ff6272cebde64b895a9ac5e2c5761a0e17736d
4
- data.tar.gz: 66e49443f9b7e591a57a35ecb5d5d106cfff2cef38e672a34ff1e5a88d56228c
3
+ metadata.gz: 2f9591bf9addbd5b82278cf7ef46962618b5ecbf3505f4472bd4615e3ff3aff2
4
+ data.tar.gz: 332fdafada6b3edfae87e665df1ae4e82bcefcf1797212dd90f6a8f5c5b82385
5
5
  SHA512:
6
- metadata.gz: 67f88d4a3a6bb532aaa552638b5719488507b7a710059ab030cdac92f5f64f52e85a5816c3ed7b320724887f20a1ee49dd24807087a51b9e57101eb7775866f1
7
- data.tar.gz: 6288c955b048426e8718effebc89692b0b5f2b3d3430c607cd8f4884e6fa4360bd1ab60e99f44cca9b8c57c14d874e93ef99f26be3be64538afd13ee2236bb8c
6
+ metadata.gz: 72b6827c60330f67ecd669d19672f1a9d3d1aa00ea38d7f312a4420bca4e993eafc11449ac7473d13463ed4d868c745c669726a603c78a514b2c1ef0eda69539
7
+ data.tar.gz: 5a83820ae23e5a1ac06973b5e6bd0dfb4eb58269f5d905aa731b0f4ec74cb41326d73255868edb5ac3f6c67e877a55ecf93c249fe4ecfcbd776331440094a0a9
@@ -19,12 +19,22 @@ module JekyllOpenSdgPlugins
19
19
  if site.config['create_goals'].key?('layout')
20
20
  layout = site.config['create_goals']['layout']
21
21
  end
22
+ # See if we need to "map" any language codes.
23
+ languages_public = Hash.new
24
+ if site.config['languages_public']
25
+ languages_public = site.config['languages_public']
26
+ end
22
27
  # Loop through the languages.
23
28
  site.config['languages'].each_with_index do |language, index|
29
+ # Get the "public language" (for URLs) which may be different.
30
+ language_public = language
31
+ if languages_public[language]
32
+ language_public = languages_public[language]
33
+ end
24
34
  # Loop through the goals.
25
35
  goals.sort.each do |goal, value|
26
36
  # Add the language subfolder for all except the default (first) language.
27
- dir = index == 0 ? goal.to_s : File.join(language, goal.to_s)
37
+ dir = index == 0 ? goal.to_s : File.join(language_public, goal.to_s)
28
38
  # Create the goal page.
29
39
  site.collections['goals'].docs << GoalPage.new(site, site.source, dir, goal, language, layout)
30
40
  end
@@ -13,12 +13,22 @@ module JekyllOpenSdgPlugins
13
13
  if site.config['create_indicators'].key?('layout')
14
14
  layout = site.config['create_indicators']['layout']
15
15
  end
16
+ # See if we need to "map" any language codes.
17
+ languages_public = Hash.new
18
+ if site.config['languages_public']
19
+ languages_public = site.config['languages_public']
20
+ end
16
21
  # Loop through the languages.
17
22
  site.config['languages'].each_with_index do |language, index|
23
+ # Get the "public language" (for URLs) which may be different.
24
+ language_public = language
25
+ if languages_public[language]
26
+ language_public = languages_public[language]
27
+ end
18
28
  # Loop through the indicators (using metadata as a list).
19
29
  site.data['meta'].each do |inid, meta|
20
30
  # Add the language subfolder for all except the default (first) language.
21
- dir = index == 0 ? inid : File.join(language, inid)
31
+ dir = index == 0 ? inid : File.join(language_public, inid)
22
32
  # Create the indicator page.
23
33
  site.collections['indicators'].docs << IndicatorPage.new(site, site.source, dir, inid, language, layout)
24
34
  end
@@ -54,12 +54,23 @@ module JekyllOpenSdgPlugins
54
54
  pages = site.config['create_pages']['pages']
55
55
  end
56
56
 
57
+ # See if we need to "map" any language codes.
58
+ languages_public = Hash.new
59
+ if site.config['languages_public']
60
+ languages_public = site.config['languages_public']
61
+ end
62
+
57
63
  # Loop through the languages.
58
64
  site.config['languages'].each_with_index do |language, index|
65
+ # Get the "public language" (for URLs) which may be different.
66
+ language_public = language
67
+ if languages_public[language]
68
+ language_public = languages_public[language]
69
+ end
59
70
  # Loop through the pages.
60
71
  pages.each do |page|
61
72
  # Add the language subfolder for all except the default (first) language.
62
- dir = index == 0 ? page['folder'] : File.join(language, page['folder'])
73
+ dir = index == 0 ? page['folder'] : File.join(language_public, page['folder'])
63
74
  # Create the page.
64
75
  site.pages << OpenSdgPage.new(site, site.source, dir, page, language)
65
76
  end
@@ -1,3 +1,3 @@
1
1
  module JekyllOpenSdgPlugins
2
- VERSION = "0.0.14".freeze
2
+ VERSION = "0.0.15".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: 0.0.14
4
+ version: 0.0.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brock Fanning
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-09-07 00:00:00.000000000 Z
11
+ date: 2019-09-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll