From 9011a938c998c3c303bbbe8bc68ce1f2eeff1a72 Mon Sep 17 00:00:00 2001 From: Kelvin Oghenerhoro Omereshone Date: Wed, 31 Jul 2024 22:45:26 +0100 Subject: [PATCH] feat(plugin-sails-content): remove unneeded check for inputDir --- packages/plugin-sails-content/lib/generate-content.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/plugin-sails-content/lib/generate-content.js b/packages/plugin-sails-content/lib/generate-content.js index 414f1f6..1738024 100644 --- a/packages/plugin-sails-content/lib/generate-content.js +++ b/packages/plugin-sails-content/lib/generate-content.js @@ -3,9 +3,7 @@ const path = require('path') const render = require('./render') const writeHtmlToOutput = require('./write-html-to-output') -async function generateContent(sails) { - const config = sails.config.content - config.outputDir = config.outputDir ? config.outputDir : '.tmp/public' +async function generateContent(config) { const files = await fs.readdir(config.inputDir) for (const file of files) { @@ -19,7 +17,7 @@ async function generateContent(sails) { outputDir: path.join(config.outputDir, file) }) } else if (fileStats.isFile() && file.toLowerCase().endsWith('.md')) { - const { renderedHtml } = await render(sails, filePath, config.layout) + const { renderedHtml } = await render(filePath, config) const outputFilePath = await writeHtmlToOutput( renderedHtml,