jekyll-archives-dir-category 0.1.4 → 0.1.5

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: 22182bbaf2a23752a2e113d5a60c8b388bf05aeb59cad9e25b1c2e91874e254c
4
- data.tar.gz: 2dbc9ff132961d84eddd40a4e1b74f26f02b1b5cd44da5b1a21407d3f1d417e6
3
+ metadata.gz: 851d4fda6842f27e53d5a044b417f1c50a04080bc040d3aa868f891d5c0135de
4
+ data.tar.gz: a8722f129daeee0f4205e388a9c47292d2141591b37839b56a2d57aecbf1aee1
5
5
  SHA512:
6
- metadata.gz: 864249ec41e6658000ddb2fc3b34855f5ec56f366d92a58626f0e87742a91511360049dc3033ad292b7b9c3a6fe2e66364b81780807388623f88d1e56b9fce34
7
- data.tar.gz: 28c8dac76d45bf85170fbc12500a02840cecd6580a92468e4e1039c47d1edaf52761ebedfd6cd0afdc7f2342f4488239047b2f6350b945a1248f329973c728a1
6
+ metadata.gz: e82ea052f9467b2322bd99b7e32c1c17a8d32e02a3b7ab9f2ee93b232ed50057f9bfc622502bb4a4dc6896a103a8e82b4adf76e15b16d38f7c8b4d692872d8f6
7
+ data.tar.gz: dad00cdf6a717b1ab90892219416909a3d4a11613693567e25a63962e58688d05265c9f67709fc9ad4d540ccb963dfd840299c3a27fbf0b6140843a198f53c8e
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Jekyll
4
4
  module Archives
5
- VERSION = "0.1.4"
5
+ VERSION = "0.1.5"
6
6
  end
7
7
  end
@@ -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["count"] = 0
137
+ info["post_count"] = 0
137
138
  else
138
- info["count"] = @posts.docs.count { |a|
139
+ info["post_count"] = @posts.docs.count { |a|
139
140
  a.data["category"].start_with? info["href"]
140
141
  }
141
142
  end
@@ -233,20 +234,27 @@ module Jekyll
233
234
  dates_info_days = []
234
235
  days(m_posts).each do |day, d_posts|
235
236
  append_enabled_date_type({ :year => year, :month => month, :day => day }, "day", d_posts)
236
- dates_info_days << "%02d" % day.to_i
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
+ }
237
241
  end
238
242
  dates_info_months << {
239
243
  "month" => "%02d" % month.to_i,
240
- "days" => dates_info_days.sort{|a, b| b <=> a},
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 },
241
246
  }
242
247
  end
243
248
  dates_info_years << {
244
249
  "year" => "%04d" % year.to_i,
245
- "months" => dates_info_months.sort{|a, b| b["month"] <=> a["month"]}
246
- }
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
+ }
247
253
  end
248
254
 
249
- @site.data["years"] = dates_info_years.sort{|a, b| b["year"] <=> a["year"]}
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
250
258
  end
251
259
 
252
260
  # Checks if archive type is enabled in config
metadata CHANGED
@@ -1,7 +1,7 @@
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
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alfred Xing