jekyll-theme-open-project-helpers 1.1.20 → 1.1.21
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: 90b1f3aa02d83e9f800cedd56b72f61fe734764b6474ee4e635b14ebc7faaaa9
|
4
|
+
data.tar.gz: 82615472bac6bf0c80fdcf0f28aa915a7505c438acfbb30519f5b86cb959f80c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 51f7d2b350597ad6879479eae51beb007bdd5792bf578931930a03f70baa768cc69ddc6cf3590fbacd9e8e742846a073236b63b9974fdc10c3819c13b560c26a
|
7
|
+
data.tar.gz: 410dee0831e16d0b1b98bf5c780a46092a41d29b1f3808ba6be55a7aa5fb976ed38b6f917af035b04c96a8c1a5bd8d8e1014dd69f5e8a8df8332f758fcbeeb19
|
@@ -43,36 +43,39 @@ module Jekyll
|
|
43
43
|
safe true
|
44
44
|
|
45
45
|
def generate(site)
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
46
|
+
INDEXES.each do |index_name, params|
|
47
|
+
if site.config['is_hub']
|
48
|
+
collection_name = 'projects'
|
49
|
+
else
|
50
|
+
collection_name = index_name
|
51
|
+
end
|
52
|
+
|
53
|
+
items = get_all_items(site, collection_name, params[:item_test])
|
54
|
+
|
55
|
+
# Creates a data structure like { tag1: [item1, item2], tag2: [item2, item3] }
|
56
|
+
tags = {}
|
57
|
+
items.each do |item|
|
58
|
+
item.data['tags'].each do |tag|
|
59
|
+
unless tags.key? tag
|
60
|
+
tags[tag] = []
|
58
61
|
end
|
62
|
+
tags[tag].push(item)
|
59
63
|
end
|
64
|
+
end
|
60
65
|
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
+
# Creates a filtered index page for each tag
|
67
|
+
tags.each do |tag, tagged_items|
|
68
|
+
site.pages << FilteredIndexPage.new(
|
69
|
+
site,
|
70
|
+
site.source,
|
66
71
|
|
67
|
-
|
68
|
-
|
72
|
+
# The filtered page will be nested under /<index page>/<tag>.html
|
73
|
+
File.join(index_name, tag),
|
69
74
|
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
end
|
75
|
+
tag,
|
76
|
+
tagged_items,
|
77
|
+
index_name)
|
74
78
|
end
|
75
|
-
|
76
79
|
end
|
77
80
|
end
|
78
81
|
end
|
@@ -128,8 +131,12 @@ def get_all_items(site, collection_name, filter_func)
|
|
128
131
|
filter_func.call(item)
|
129
132
|
}
|
130
133
|
|
134
|
+
default_time = Time.new(1989, 12, 31, 0, 0, 0, "+00:00")
|
135
|
+
|
131
136
|
items.sort! { |i1, i2|
|
132
|
-
|
137
|
+
val1 = i1.data.fetch('last_update', default_time) || default_time
|
138
|
+
val2 = i2.data.fetch('last_update', default_time) || default_time
|
139
|
+
(val2 <=> val1) || 0
|
133
140
|
}
|
134
141
|
|
135
142
|
if site.config['is_hub']
|
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.21
|
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-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|