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