jekyll-archives-dir-category 0.1.2 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/jekyll-archives-dir-category/version.rb +1 -1
- data/lib/jekyll-archives-dir-category.rb +26 -4
- 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: 51f99c38c390df3f76d5e599923412a807acbbf856633afcd3d4e2e2f2822186
|
4
|
+
data.tar.gz: ab314678395c075446f7e06ec8a5cbfc6c315e1b05ab2a931330eb43bbe8028b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 784a93fb04f52507ea5bf2e8821c377399bf3bca646243521318dd5ea4d063161306f9526b3a3a53c1204b25211a8cb875949e96cc03cc2e978d8b983e8a5c96
|
7
|
+
data.tar.gz: 3c7898774af1b19fd1f036a2ef14ef3aa18a5f945d8c4e75c528dc0f505b1cd41d58b37c024a854fab510d5b0f930d2bdacf05c536dcdd2de3325c9e0880bfad
|
@@ -91,13 +91,13 @@ module Jekyll
|
|
91
91
|
cn = get_category_name(path)
|
92
92
|
p.data["category"] = c
|
93
93
|
p.data["categories"] = [c]
|
94
|
-
p.data["
|
94
|
+
p.data["category_name"] = cn
|
95
95
|
io = IO.popen('git log -1 --pretty="format:%cI" ' + p.path)
|
96
96
|
date_str = io.gets
|
97
97
|
# printf("post:%s\n", p.path)
|
98
98
|
# printf(" pwd :%s", `pwd`)
|
99
99
|
# printf(" date:%s\n\n", date_str)
|
100
|
-
p.data["
|
100
|
+
p.data["update_time"] = date_str
|
101
101
|
# printf("Post date:%s\n", `git log -1 --pretty="format:%cI" $p`)
|
102
102
|
# printf(" category:%s\n", c)
|
103
103
|
# printf(" category name:%s\n\n", cn)
|
@@ -109,6 +109,7 @@ module Jekyll
|
|
109
109
|
category_info << c
|
110
110
|
end
|
111
111
|
site.data["category-info"] = category_info
|
112
|
+
# print category_info.inspect
|
112
113
|
end
|
113
114
|
|
114
115
|
# the category info from '_category.yml' file
|
@@ -133,9 +134,9 @@ module Jekyll
|
|
133
134
|
info["priority"] = category_info["priority"] if !category_info["priority"].nil?
|
134
135
|
end
|
135
136
|
if info["href"].nil?
|
136
|
-
info["
|
137
|
+
info["post_count"] = 0
|
137
138
|
else
|
138
|
-
info["
|
139
|
+
info["post_count"] = @posts.docs.count { |a|
|
139
140
|
a.data["category"].start_with? info["href"]
|
140
141
|
}
|
141
142
|
end
|
@@ -224,15 +225,36 @@ module Jekyll
|
|
224
225
|
end
|
225
226
|
|
226
227
|
def read_dates
|
228
|
+
dates_info_years = []
|
227
229
|
years.each do |year, y_posts|
|
228
230
|
append_enabled_date_type({ :year => year }, "year", y_posts)
|
231
|
+
dates_info_months = []
|
229
232
|
months(y_posts).each do |month, m_posts|
|
230
233
|
append_enabled_date_type({ :year => year, :month => month }, "month", m_posts)
|
234
|
+
dates_info_days = []
|
231
235
|
days(m_posts).each do |day, d_posts|
|
232
236
|
append_enabled_date_type({ :year => year, :month => month, :day => day }, "day", d_posts)
|
237
|
+
dates_info_days << {
|
238
|
+
"day" => "%02d" % day.to_i,
|
239
|
+
"post_count" => @posts.docs.count {|p| p.date.year == year.to_i && p.date.month == month.to_i && p.date.day == day.to_i },
|
240
|
+
}
|
233
241
|
end
|
242
|
+
dates_info_months << {
|
243
|
+
"month" => "%02d" % month.to_i,
|
244
|
+
"days" => dates_info_days.sort{|a, b| b["day"] <=> a["day"]},
|
245
|
+
"post_count" => @posts.docs.count {|p| p.date.year == year.to_i && p.date.month == month.to_i },
|
246
|
+
}
|
234
247
|
end
|
248
|
+
dates_info_years << {
|
249
|
+
"year" => "%04d" % year.to_i,
|
250
|
+
"months" => dates_info_months.sort{|a, b| b["month"] <=> a["month"]},
|
251
|
+
"post_count" => @posts.docs.count {|p| p.date.year == year.to_i },
|
252
|
+
}
|
235
253
|
end
|
254
|
+
|
255
|
+
@site.data["date-info"] = dates_info_years.sort{|a, b| b["year"] <=> a["year"]}
|
256
|
+
# print "\n=================================\n"
|
257
|
+
# print @site.data["date-info"].inspect
|
236
258
|
end
|
237
259
|
|
238
260
|
# Checks if archive type is enabled in config
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-archives-dir-category
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alfred Xing
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-10-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|