jekyll-archives-hofill 0.0.1 → 0.0.2
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/version.rb +1 -1
- data/lib/jekyll-archives.rb +14 -9
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: acf0eb64cc9a7d68457aacb0b9f25152d2bef05516184ed4a7d77947b1f0898c
|
4
|
+
data.tar.gz: fb5730c321921218d1b0c9fb6f58260bdca2d4e14523f33a6564935bcc368c6f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ce544a766e3d1375daa8fe55b31459de60a80ed3914744adb445f22d6a149396ec8d94a7e66b56aa5650582d1c2ab4e7157ed9a6253c1fb0472f18ff34366f93
|
7
|
+
data.tar.gz: 161efa183cb1871478ab2d4657d327e7939c5691781668f64d1ddc44b427207bfa877bb430bdc0255bfafb09a1e9404c33380166859dcc8dc2970704acda967c
|
data/lib/jekyll-archives.rb
CHANGED
@@ -12,14 +12,14 @@ module Jekyll
|
|
12
12
|
safe true
|
13
13
|
|
14
14
|
DEFAULTS = {
|
15
|
-
"layout"
|
16
|
-
"enabled"
|
15
|
+
"layout" => "archive",
|
16
|
+
"enabled" => [],
|
17
17
|
"permalinks" => {
|
18
|
-
"year"
|
19
|
-
"month"
|
20
|
-
"day"
|
21
|
-
"tag"
|
22
|
-
"category"
|
18
|
+
"year" => "/:year/",
|
19
|
+
"month" => "/:year/:month/",
|
20
|
+
"day" => "/:year/:month/:day/",
|
21
|
+
"tag" => "/tag/:name/",
|
22
|
+
"category" => "/category/:name/",
|
23
23
|
"writeup-category" => "/writeups/:name/",
|
24
24
|
},
|
25
25
|
}.freeze
|
@@ -56,6 +56,7 @@ module Jekyll
|
|
56
56
|
read_tags
|
57
57
|
read_categories
|
58
58
|
read_dates
|
59
|
+
read_writeup_categories
|
59
60
|
end
|
60
61
|
|
61
62
|
def read_tags
|
@@ -77,7 +78,7 @@ module Jekyll
|
|
77
78
|
def read_writeup_categories
|
78
79
|
if enabled? "writeup_categories"
|
79
80
|
writeup_categories.each do |title, posts|
|
80
|
-
|
81
|
+
@archives << Archive.new(@site, title, "writeup-category", posts)
|
81
82
|
end
|
82
83
|
end
|
83
84
|
end
|
@@ -110,8 +111,12 @@ module Jekyll
|
|
110
111
|
def writeup_categories
|
111
112
|
final_result = {}
|
112
113
|
@site.posts.each do |item|
|
114
|
+
next if item["writeup_categories"].nil?
|
115
|
+
|
113
116
|
item["writeup_categories"].each do |category|
|
114
|
-
final_result[category]
|
117
|
+
to_add = final_result.key?(category) ? final_result[category] : []
|
118
|
+
to_add.append(item)
|
119
|
+
final_result[category] = to_add
|
115
120
|
end
|
116
121
|
end
|
117
122
|
final_result
|