From 7c10a5e993e4c064e822643d7a4b45c92ea8f9f8 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Thu, 18 May 2017 15:27:17 -0500 Subject: [PATCH] add month_name and month_number --- lib/aggregate-core.js | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) 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); });