diff --git a/lib/aggregate-core.js b/lib/aggregate-core.js index 167be35..84b93a0 100644 --- a/lib/aggregate-core.js +++ b/lib/aggregate-core.js @@ -71,10 +71,10 @@ ; entities.forEach(function (f) { - var set - , yindex = 3000 - f.year - , mindex = 12 - f.month - ; + var set; + var yindex = 3000 - f.year; + var mindex = 12 - f.month; + var monthName = months[parseInt(f.month, 10)]; f.url = path.join(env.base_path, f.permalink); @@ -84,10 +84,17 @@ set = yearsArr[yindex]; if (!set.months[mindex]) { - set.months[mindex] = { month: months[parseInt(f.month, 10)], pages: [] }; + set.months[mindex] = { + month_name: monthName + , month_number: mindex + , month: monthName + , pages: [] + }; } set = set.months[mindex]; + f.month_name = months[parseInt(f.month, 10)]; + f.month_number = parseInt(f.month, 10); set.pages.push(f); });