@@ -41,46 +41,46 @@ def generate(site)
41
41
end
42
42
43
43
def enabled? ( archive )
44
- @config [ ' enabled' ] == true || @config [ ' enabled' ] == ' all' ||
45
- ( @config [ ' enabled' ] . is_a? ( Array ) && @config [ ' enabled' ] . include? ( archive ) )
44
+ @config [ " enabled" ] == true || @config [ " enabled" ] == " all" ||
45
+ ( @config [ " enabled" ] . is_a? ( Array ) && @config [ " enabled" ] . include? ( archive ) )
46
46
end
47
47
48
48
# Read archive data from posts
49
49
def read
50
- read_tags if enabled? ( ' tags' )
51
- read_categories if enabled? ( ' categories' )
52
- read_posts_per_year if enabled? ( ' year' )
53
- read_posts_per_month if enabled? ( ' month' )
54
- read_posts_per_day if enabled? ( ' day' )
50
+ read_tags if enabled? ( " tags" )
51
+ read_categories if enabled? ( " categories" )
52
+ read_posts_per_year if enabled? ( " year" )
53
+ read_posts_per_month if enabled? ( " month" )
54
+ read_posts_per_day if enabled? ( " day" )
55
55
end
56
56
57
57
def read_tags
58
- @archives += @site . post_attr_hash ( ' tags' ) . map do |title , posts |
59
- Archive . new ( @site , title , ' tag' , posts )
58
+ @archives += @site . post_attr_hash ( " tags" ) . map do |title , posts |
59
+ Archive . new ( @site , title , " tag" , posts )
60
60
end
61
61
end
62
62
63
63
def read_categories
64
- @archives += @site . post_attr_hash ( ' categories' ) . map do |title , posts |
65
- Archive . new ( @site , title , ' category' , posts )
64
+ @archives += @site . post_attr_hash ( " categories" ) . map do |title , posts |
65
+ Archive . new ( @site , title , " category" , posts )
66
66
end
67
67
end
68
68
69
69
def read_posts_per_year
70
70
@archives += @posts . docs . group_by { |p | p . date . year } . map do |year , posts_for_year |
71
- Archive . new ( @site , { :year => year } , ' year' , posts_for_year . sort . reverse )
71
+ Archive . new ( @site , { :year => year } , " year" , posts_for_year . sort . reverse )
72
72
end
73
73
end
74
74
75
75
def read_posts_per_month
76
76
@archives += @posts . docs . group_by { |p | [ p . date . year , p . date . month ] } . map do |( year , month ) , posts_for_month |
77
- Archive . new ( @site , { :year => year , :month => month } , ' month' , posts_for_month . sort . reverse )
77
+ Archive . new ( @site , { :year => year , :month => month } , " month" , posts_for_month . sort . reverse )
78
78
end
79
79
end
80
80
81
81
def read_posts_per_day
82
82
@archives += @posts . docs . group_by { |p | [ p . date . year , p . date . month , p . date . day ] } . map do |( year , month , day ) , posts_for_day |
83
- Archive . new ( @site , { :year => year , :month => month , :day => day } , ' day' , posts_for_day . sort . reverse )
83
+ Archive . new ( @site , { :year => year , :month => month , :day => day } , " day" , posts_for_day . sort . reverse )
84
84
end
85
85
end
86
86
end
0 commit comments