|
|
|
@ -36,6 +36,13 @@ export default class Render {
|
|
|
|
|
let rendered = 0;
|
|
|
|
|
let display_count = 0;
|
|
|
|
|
let recent = [];
|
|
|
|
|
let featured = _.filter(pages, page => {
|
|
|
|
|
return (
|
|
|
|
|
page.metadata.deleted === false &&
|
|
|
|
|
page.metadata.published === true &&
|
|
|
|
|
page.metadata.featured === true
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
for (let index = 0; index < pages.length; index++) {
|
|
|
|
|
pages.sort((a, b) => parseFloat(b.metadata.id) - parseFloat(a.metadata.id));
|
|
|
|
|
|
|
|
|
@ -52,6 +59,7 @@ export default class Render {
|
|
|
|
|
display_count = ++display_count;
|
|
|
|
|
}
|
|
|
|
|
let writeFile, template;
|
|
|
|
|
|
|
|
|
|
let path =
|
|
|
|
|
'public/' +
|
|
|
|
|
moment(page.metadata.created).format('YYYY') +
|
|
|
|
@ -91,6 +99,7 @@ export default class Render {
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
buffed = new StringUtils().decodeHTML(buffed);
|
|
|
|
|
|
|
|
|
|
let html = md.render(buffed, { html: true, xhtmlOut: true });
|
|
|
|
|
let file = pug.renderFile(template, {
|
|
|
|
|
title: page.metadata.title,
|
|
|
|
@ -99,6 +108,7 @@ export default class Render {
|
|
|
|
|
tags: tags,
|
|
|
|
|
menu: config.menu,
|
|
|
|
|
recent_posts: recent,
|
|
|
|
|
featured_posts: featured,
|
|
|
|
|
meta: {
|
|
|
|
|
who: author,
|
|
|
|
|
when: moment(page.metadata.created).fromNow(),
|
|
|
|
|