jekyll-archives-dir-category 0.1.0 → 0.1.5
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 +32 -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: 851d4fda6842f27e53d5a044b417f1c50a04080bc040d3aa868f891d5c0135de
|
4
|
+
data.tar.gz: a8722f129daeee0f4205e388a9c47292d2141591b37839b56a2d57aecbf1aee1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e82ea052f9467b2322bd99b7e32c1c17a8d32e02a3b7ab9f2ee93b232ed50057f9bfc622502bb4a4dc6896a103a8e82b4adf76e15b16d38f7c8b4d692872d8f6
|
7
|
+
data.tar.gz: dad00cdf6a717b1ab90892219416909a3d4a11613693567e25a63962e58688d05265c9f67709fc9ad4d540ccb963dfd840299c3a27fbf0b6140843a198f53c8e
|
@@ -91,8 +91,14 @@ module Jekyll
|
|
91
91
|
cn = get_category_name(path)
|
92
92
|
p.data["category"] = c
|
93
93
|
p.data["categories"] = [c]
|
94
|
-
p.data["
|
95
|
-
|
94
|
+
p.data["category_name"] = cn
|
95
|
+
io = IO.popen('git log -1 --pretty="format:%cI" ' + p.path)
|
96
|
+
date_str = io.gets
|
97
|
+
# printf("post:%s\n", p.path)
|
98
|
+
# printf(" pwd :%s", `pwd`)
|
99
|
+
# printf(" date:%s\n\n", date_str)
|
100
|
+
p.data["update_time"] = date_str
|
101
|
+
# printf("Post date:%s\n", `git log -1 --pretty="format:%cI" $p`)
|
96
102
|
# printf(" category:%s\n", c)
|
97
103
|
# printf(" category name:%s\n\n", cn)
|
98
104
|
end
|
@@ -103,6 +109,7 @@ module Jekyll
|
|
103
109
|
category_info << c
|
104
110
|
end
|
105
111
|
site.data["category-info"] = category_info
|
112
|
+
print category_info.inspect
|
106
113
|
end
|
107
114
|
|
108
115
|
# the category info from '_category.yml' file
|
@@ -127,9 +134,9 @@ module Jekyll
|
|
127
134
|
info["priority"] = category_info["priority"] if !category_info["priority"].nil?
|
128
135
|
end
|
129
136
|
if info["href"].nil?
|
130
|
-
info["
|
137
|
+
info["post_count"] = 0
|
131
138
|
else
|
132
|
-
info["
|
139
|
+
info["post_count"] = @posts.docs.count { |a|
|
133
140
|
a.data["category"].start_with? info["href"]
|
134
141
|
}
|
135
142
|
end
|
@@ -218,15 +225,36 @@ module Jekyll
|
|
218
225
|
end
|
219
226
|
|
220
227
|
def read_dates
|
228
|
+
dates_info_years = []
|
221
229
|
years.each do |year, y_posts|
|
222
230
|
append_enabled_date_type({ :year => year }, "year", y_posts)
|
231
|
+
dates_info_months = []
|
223
232
|
months(y_posts).each do |month, m_posts|
|
224
233
|
append_enabled_date_type({ :year => year, :month => month }, "month", m_posts)
|
234
|
+
dates_info_days = []
|
225
235
|
days(m_posts).each do |day, d_posts|
|
226
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
|
+
}
|
227
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
|
+
}
|
228
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
|
+
}
|
229
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
|
230
258
|
end
|
231
259
|
|
232
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.5
|
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
|