From 93841318ab7fb37b4802e259aa837449c33729a8 Mon Sep 17 00:00:00 2001 From: Ro Date: Mon, 20 Jul 2020 14:24:48 -0700 Subject: [PATCH] tweaked recent post filtering for index --- brain/data/Render.js | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/brain/data/Render.js b/brain/data/Render.js index 1ad557f..2e53947 100644 --- a/brain/data/Render.js +++ b/brain/data/Render.js @@ -46,23 +46,21 @@ export default class Render { }); for (let index = 0; index < pages.length; index++) { pages.sort((a, b) => parseFloat(b.metadata.id) - parseFloat(a.metadata.id)); - const page = pages[index]; - if ( - page.metadata.deleted === false && - page.metadata.published === true && - page.metadata.layout !== 'index' - ) { - 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; + if (page.metadata.deleted === false && page.metadata.published === true) { + if (page.metadata.layout != 'index') { + 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 path = @@ -104,7 +102,6 @@ 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, @@ -172,6 +169,7 @@ export default class Render { } }) .catch(err => { + //console.log('ERROR', err); reject(err); }); });