tightned up archive filtering, removed index and deleted pages links on archive html page

pull/20/head
Ro 5 years ago
parent f7e40b713d
commit 8bdc7cbfe9

@ -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]);
}
}

Loading…
Cancel
Save