|
|
|
@ -69,27 +69,25 @@ export default class Utils {
|
|
|
|
|
let obj = filtered[index].metadata;
|
|
|
|
|
let month = moment(obj.created).format('MM');
|
|
|
|
|
if (!_.find(sorted, { month: month })) {
|
|
|
|
|
let sortedPages = _.filter(pages, page => {
|
|
|
|
|
return (
|
|
|
|
|
moment(page.metadata.created).format('YYYY') === item.year &&
|
|
|
|
|
moment(page.metadata.created).format('MM') === month
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
sorted.push({
|
|
|
|
|
month: month,
|
|
|
|
|
full_month: moment(obj.created).format('MMMM'),
|
|
|
|
|
count: 1,
|
|
|
|
|
pages: sortedPages
|
|
|
|
|
pages: _.filter(pages, page => {
|
|
|
|
|
return (
|
|
|
|
|
moment(page.metadata.created).format('YYYY') === item.year &&
|
|
|
|
|
moment(page.metadata.created).format('MM') === month &&
|
|
|
|
|
page.metadata.deleted === false &&
|
|
|
|
|
page.metadata.layout !== 'index'
|
|
|
|
|
);
|
|
|
|
|
})
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
_.find(sorted, { month: month }).count++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
archive.push({ year: item.year, year_data: sorted });
|
|
|
|
|
}
|
|
|
|
|
render.publishArchive(archive);
|
|
|
|
|
//console.log('ARCHIVE', archive[0].meta[0]);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|