jekyll-theme-open-project-helpers 1.1.16 → 1.1.17

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8efd49614e63289ce6e6ee32e5b8363d6d6392ee4f340a4b49de6f91494d98d0
4
- data.tar.gz: 6d6377cbb02af6c9722a13b288310418c141d95c09dd9c4a1f47dbc7c4a29722
3
+ metadata.gz: fad190658ba13e26671d06f21719d518af3528469e36a5dd7818da16b295f514
4
+ data.tar.gz: 71f8d586a0ed944fceb6385fdc4b90b80faa6b52b033cff3e293d2f139c90dee
5
5
  SHA512:
6
- metadata.gz: 5e1855571673f361ad689620ec004edd7b46d4f1ab6b80bafca316b6fc8ea446297f370aa9833bdd9a002d8d2b34000e3ece05afb78bfc1725c8216f4ead599a
7
- data.tar.gz: 32cce1e28e09cc97bc9454242b201250e8496691b2f8d7d45a32b473153efa43cc38acaa011afb1aada83d068a6f2ece0ca8eb3136521daab13122b57328d05d
6
+ metadata.gz: 9f13e4d98612231c61aecc8ffbb2bee5727b4f19e1488b8a94289b9fd7f0517a7148892ff85ce8f8dc844297a85e18f01238efe2868f82328b97c05e1e498da4
7
+ data.tar.gz: 5de24d824b543a2d26ee8cfaffe080a88efe78e2183092b62ca0f65d0b64c2b3c72da2935a08ce1822cf4e858c32b1a554001a6709e9cde4e386556922bb1d31
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = 'jekyll-theme-open-project-helpers'
5
- s.version = '1.1.16'
5
+ s.version = '1.1.17'
6
6
  s.authors = ['Ribose Inc.']
7
7
  s.email = ['open.source@ribose.com']
8
8
 
@@ -85,9 +85,9 @@ module Jekyll
85
85
  safe true
86
86
 
87
87
  def generate(site)
88
- site.config['num_featured_software'] = 3
89
- site.config['num_featured_specs'] = 3
90
- site.config['num_featured_posts'] = 3
88
+ site.config['max_featured_software'] = 3
89
+ site.config['max_featured_specs'] = 3
90
+ site.config['max_featured_posts'] = 3
91
91
 
92
92
  INDEXES.each do |index_name, params|
93
93
  if site.config['is_hub']
@@ -98,11 +98,32 @@ module Jekyll
98
98
 
99
99
  if site.collections.key? collection_name
100
100
  # Filters items from given collection_name through item_test function
101
+ # and makes items available in templates via e.g. site.all_specs, site.all_software
102
+
101
103
  items = site.collections[collection_name].docs.select { |item| params[:item_test].call(item) }
102
104
 
103
- # Makes items available in templates via e.g. site.all_specs, site.all_software
105
+ if site.config['is_hub']
106
+ items.map! do |item|
107
+ project_name = item.url.split('/')[2]
108
+ project_path = "_projects/#{project_name}/index.md"
109
+
110
+ item.data[:project_name] = project_name
111
+ item.data[:project_data] = site.collections['projects'].docs.select { |proj| proj.path.end_with? project_path } [0]
112
+
113
+ item
114
+ end
115
+ end
116
+
104
117
  site.config["all_#{index_name}"] = items
105
118
  site.config["num_all_#{index_name}"] = items.size
119
+
120
+ featured_items = items.select { |item| item.data['feature_with_priority'] != nil }
121
+ site.config["featured_#{index_name}"] = featured_items
122
+ site.config["num_featured_#{index_name}"] = featured_items.size
123
+
124
+ non_featured_items = items.select { |item| item.data['feature_with_priority'] == nil }
125
+ site.config["non_featured_#{index_name}"] = non_featured_items
126
+ site.config["num_non_featured_#{index_name}"] = non_featured_items.size
106
127
  end
107
128
  end
108
129
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-theme-open-project-helpers
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.16
4
+ version: 1.1.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-10-07 00:00:00.000000000 Z
11
+ date: 2018-10-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll