From f7e9e44cca91aec1dc91481d578d856591586893 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=83=9D=E3=83=BC=E3=83=AB=20=E3=82=A6=E3=82=A7=E3=83=83?= =?UTF-8?q?=E3=83=96?= Date: Fri, 28 Sep 2018 15:16:29 -0500 Subject: [PATCH] Closes #154 --- app/views/redirect.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app/views/redirect.js b/app/views/redirect.js index 3245367..f721e0a 100644 --- a/app/views/redirect.js +++ b/app/views/redirect.js @@ -143,7 +143,11 @@ function partialFinder(markdownBody) { const filename = decamelize(partial, "-").replace("<", "").replace("/>", ""); const fileExistsTest = exists(`./app/components/${filename}.js`); // `local` results in error if used here and file !exist - if (fileExistsTest) { + if (!fileExistsTest) { + markdownBody = markdownBody.replace(partial, ""); + } + + else { const partialFunction = require(path.join(__dirname, "..", `./components/${filename}.js`)); if (filename === "glossary-toc") markdownBody = markdownBody.replace(partial, partialFunction); @@ -157,9 +161,8 @@ function partialFinder(markdownBody) { function updateMetadata(metadataDetails) { const generatedMetadata = []; - for (const metadataDetail of metadataDetails) { + for (const metadataDetail of metadataDetails) generatedMetadata.push(createMetaTags(metadataDetail)); - } return html`