@@ -43,12 +43,14 @@ def initialize(site,base,lang,year,month,posts)
43
43
@dir = File . join ( @dir , @year . to_s , "%.2d" % @month )
44
44
45
45
if site . config [ 'locales' ] [ 'news' ] [ lang ]
46
- title = site . config [ 'locales' ] [ 'news' ] [ lang ] [ 'archive_title ' ]
46
+ title = site . config [ 'locales' ] [ 'news' ] [ lang ] [ 'monthly_archive_title ' ]
47
47
else
48
- title = site . config [ 'locales' ] [ 'news' ] [ 'en' ] [ 'archive_title ' ]
48
+ title = site . config [ 'locales' ] [ 'news' ] [ 'en' ] [ 'monthly_archive_title ' ]
49
49
end
50
50
51
- data [ 'title' ] = "#{ title [ 'prefix' ] } #{ MONTHS [ @month ] } #{ @year } #{ title [ 'postfix' ] } " . strip
51
+ data [ 'title' ] = title . gsub ( /%Y|%m|%B/ , {
52
+ '%Y' => @year . to_s , '%m' => @month , '%B' => MONTHS [ @month ]
53
+ } )
52
54
data [ 'year' ] = year
53
55
end
54
56
@@ -65,12 +67,12 @@ def initialize(site,base,lang,year,posts)
65
67
@dir = File . join ( @dir , @year . to_s )
66
68
67
69
if site . config [ 'locales' ] [ 'news' ] [ lang ]
68
- title = site . config [ 'locales' ] [ 'news' ] [ lang ] [ 'archive_title ' ]
70
+ title = site . config [ 'locales' ] [ 'news' ] [ lang ] [ 'yearly_archive_title ' ]
69
71
else
70
- title = site . config [ 'locales' ] [ 'news' ] [ 'en' ] [ 'archive_title ' ]
72
+ title = site . config [ 'locales' ] [ 'news' ] [ 'en' ] [ 'yearly_archive_title ' ]
71
73
end
72
74
73
- data [ 'title' ] = " #{ title [ 'prefix' ] } #{ @year } #{ title [ 'postfix' ] } " . strip
75
+ data [ 'title' ] = title . gsub ( '%Y' , @year . to_s )
74
76
75
77
months = posts . map { |post | post . date . month } . uniq
76
78
0 commit comments