|
|
@ -46,13 +46,9 @@ export default class Render {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
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));
|
|
|
|
|
|
|
|
|
|
|
|
const page = pages[index];
|
|
|
|
const page = pages[index];
|
|
|
|
if (
|
|
|
|
if (page.metadata.deleted === false && page.metadata.published === true) {
|
|
|
|
page.metadata.deleted === false &&
|
|
|
|
if (page.metadata.layout != 'index') {
|
|
|
|
page.metadata.published === true &&
|
|
|
|
|
|
|
|
page.metadata.layout !== 'index'
|
|
|
|
|
|
|
|
) {
|
|
|
|
|
|
|
|
if (recent.length < config.global.display_limit) {
|
|
|
|
if (recent.length < config.global.display_limit) {
|
|
|
|
recent.push({
|
|
|
|
recent.push({
|
|
|
|
title: page.metadata.title,
|
|
|
|
title: page.metadata.title,
|
|
|
@ -63,6 +59,8 @@ export default class Render {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
display_count = ++display_count;
|
|
|
|
display_count = ++display_count;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
let writeFile, template;
|
|
|
|
let writeFile, template;
|
|
|
|
|
|
|
|
|
|
|
|
let path =
|
|
|
|
let path =
|
|
|
@ -104,7 +102,6 @@ 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,
|
|
|
@ -172,6 +169,7 @@ export default class Render {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
.catch(err => {
|
|
|
|
.catch(err => {
|
|
|
|
|
|
|
|
//console.log('ERROR', err);
|
|
|
|
reject(err);
|
|
|
|
reject(err);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|