Skip to content

Commit

Permalink
feat(plugin-sails-content): remove unneeded check for inputDir
Browse files Browse the repository at this point in the history
  • Loading branch information
DominusKelvin committed Jul 31, 2024
1 parent e2d5cc5 commit 9011a93
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions packages/plugin-sails-content/lib/generate-content.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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,
Expand Down

0 comments on commit 9011a93

Please sign in to comment.