jekyll-theme-open-project-helpers 1.1.18 → 1.1.19
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4b9aa6d67929c506280237ffe2f2118aa30da9f29aedc28507638b745123ef74
|
4
|
+
data.tar.gz: e02c812945c6b9339d3e8eec80c8cc43ae59b16e724d18e58a97dc063098499e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 54a51c476e2fa31a58b6e8ebcf1f257fb2db6bfd62df2c1dc9ce4d9ba084ea650d01d57e564f22088f34d184513420f5ea096ab9fcfed55398b37c0a9251c6af
|
7
|
+
data.tar.gz: 41c04f526c9ca99710305853d4ebcfc0ca63a0f75c4ad02a5907724147c08e7459cffcc3c050f04e784048695c7bf4761fc6979c3331aae715cae938d94af2eb
|
@@ -45,7 +45,7 @@ module Jekyll
|
|
45
45
|
def generate(site)
|
46
46
|
if site.config['is_hub']
|
47
47
|
INDEXES.each do |index_name, params|
|
48
|
-
items = site
|
48
|
+
items = get_all_items(site, 'projects', params[:item_test])
|
49
49
|
|
50
50
|
# Creates a data structure like { tag1: [item1, item2], tag2: [item2, item3] }
|
51
51
|
tags = {}
|
@@ -100,19 +100,7 @@ module Jekyll
|
|
100
100
|
# Filters items from given collection_name through item_test function
|
101
101
|
# and makes items available in templates via e.g. site.all_specs, site.all_software
|
102
102
|
|
103
|
-
items = site
|
104
|
-
|
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
|
103
|
+
items = get_all_items(site, collection_name, params[:item_test])
|
116
104
|
|
117
105
|
site.config["all_#{index_name}"] = items
|
118
106
|
site.config["num_all_#{index_name}"] = items.size
|
@@ -131,3 +119,32 @@ module Jekyll
|
|
131
119
|
|
132
120
|
end
|
133
121
|
end
|
122
|
+
|
123
|
+
|
124
|
+
def get_all_items(site, collection_name, filter_func)
|
125
|
+
# Fetches items of specified type, ordered and prepared for usage in index templates
|
126
|
+
|
127
|
+
items = site.collections[collection_name].docs.select { |item|
|
128
|
+
filter_func.call(item)
|
129
|
+
}
|
130
|
+
|
131
|
+
items.sort! { |i1, i2|
|
132
|
+
(i2.data['last_update'] <=> i1.data['last_update']) || 0
|
133
|
+
}
|
134
|
+
|
135
|
+
if site.config['is_hub']
|
136
|
+
items.map! do |item|
|
137
|
+
project_name = item.url.split('/')[2]
|
138
|
+
project_path = "_projects/#{project_name}/index.md"
|
139
|
+
|
140
|
+
item.data[:project_name] = project_name
|
141
|
+
item.data[:project_data] = site.collections['projects'].docs.select {
|
142
|
+
|proj| proj.path.end_with? project_path
|
143
|
+
} [0]
|
144
|
+
|
145
|
+
item
|
146
|
+
end
|
147
|
+
end
|
148
|
+
|
149
|
+
return items
|
150
|
+
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.
|
4
|
+
version: 1.1.19
|
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-
|
11
|
+
date: 2018-10-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|