forked from projects/fipamo
tightned up archive filtering, removed index and deleted pages links on archive html page
This commit is contained in:
parent
f7e40b713d
commit
8bdc7cbfe9
1 changed files with 8 additions and 10 deletions
|
@ -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…
Reference in a new issue