|
|
@ -34,11 +34,24 @@ export default class Render {
|
|
|
|
return page.metadata.deleted === false && page.metadata.published === true;
|
|
|
|
return page.metadata.deleted === false && page.metadata.published === true;
|
|
|
|
}).length;
|
|
|
|
}).length;
|
|
|
|
let rendered = 0;
|
|
|
|
let rendered = 0;
|
|
|
|
|
|
|
|
let display_count = 0;
|
|
|
|
|
|
|
|
let recent = [];
|
|
|
|
for (let index = 0; index < pages.length; index++) {
|
|
|
|
for (let index = 0; index < pages.length; index++) {
|
|
|
|
|
|
|
|
pages.sort((a, b) => parseFloat(b.metadata.id) - parseFloat(a.metadata.id));
|
|
|
|
|
|
|
|
|
|
|
|
const page = pages[index];
|
|
|
|
const page = pages[index];
|
|
|
|
if (page.metadata.deleted === false && page.metadata.published === true) {
|
|
|
|
if (page.metadata.deleted === false && page.metadata.published === true) {
|
|
|
|
|
|
|
|
if (recent.length < config.global.display_limit) {
|
|
|
|
|
|
|
|
recent.push({
|
|
|
|
|
|
|
|
title: page.metadata.title,
|
|
|
|
|
|
|
|
slug: page.metadata.slug,
|
|
|
|
|
|
|
|
feature: page.metadata.feature,
|
|
|
|
|
|
|
|
created: moment(page.metadata.created).fromNow(),
|
|
|
|
|
|
|
|
path: page.metadata.path
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
display_count = ++display_count;
|
|
|
|
|
|
|
|
}
|
|
|
|
let writeFile, template;
|
|
|
|
let writeFile, template;
|
|
|
|
//create case for index path
|
|
|
|
|
|
|
|
let path =
|
|
|
|
let path =
|
|
|
|
'public/' +
|
|
|
|
'public/' +
|
|
|
|
moment(page.metadata.created).format('YYYY') +
|
|
|
|
moment(page.metadata.created).format('YYYY') +
|
|
|
@ -85,6 +98,7 @@ export default class Render {
|
|
|
|
content: html,
|
|
|
|
content: html,
|
|
|
|
tags: tags,
|
|
|
|
tags: tags,
|
|
|
|
menu: config.menu,
|
|
|
|
menu: config.menu,
|
|
|
|
|
|
|
|
recent_posts: recent,
|
|
|
|
meta: {
|
|
|
|
meta: {
|
|
|
|
who: author,
|
|
|
|
who: author,
|
|
|
|
when: moment(page.metadata.created).fromNow(),
|
|
|
|
when: moment(page.metadata.created).fromNow(),
|
|
|
|