Skip to content

Commit

Permalink
Solves #397: reads metalsmith config file with ms.matter.parse
Browse files Browse the repository at this point in the history
  • Loading branch information
webketje committed Feb 10, 2024
1 parent b475373 commit b5aee71
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion bin/metalsmith
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ async function buildCommand({ config, ...cliOptions }) {
fatal(`it seems like ${config} is empty. Make sure it exports a metalsmith config object.`)
}
} else {
spec = JSON.parse(readFileSync(path, 'utf-8'))
const tempMs = new Metalsmith(confRelativeDir)
spec = tempMs.matter.parse(tempMs.matter.wrap(readFileSync(path, 'utf-8')))
}
} catch (e) {
fatal(`it seems like ${config} is malformed or unsupported. Encountered error: ${e.message}`)
Expand Down

0 comments on commit b5aee71

Please sign in to comment.