macos-defaults/build/docusaurus/build.js
2020-09-26 20:24:54 +02:00

17 lines
532 B
JavaScript

const fs = require('fs')
const YAML = require('yaml')
const writeHomepage = require('./write-homepage')
const writePages = require('./write-pages')
const writeConfig = require('./write-config')
const input = fs.readFileSync('../../defaults.yml', 'utf8')
const defaults = YAML.parse(input)
const templatesPath = 'templates'
const destinationPath = 'dist'
writeHomepage(defaults, templatesPath, destinationPath)
writePages(defaults, templatesPath, `${destinationPath}/docs`)
writeConfig(defaults, templatesPath, destinationPath)