2020-09-20 09:15:09 +00:00
|
|
|
const fs = require('fs')
|
|
|
|
const YAML = require('yaml')
|
|
|
|
|
2020-09-13 19:28:38 +00:00
|
|
|
const writeHomepage = require('./write-homepage')
|
|
|
|
const writeCategories = require('./write-categories')
|
|
|
|
const writePages = require('./write-pages')
|
|
|
|
const writeConfig = require('./write-config')
|
2020-09-20 09:15:09 +00:00
|
|
|
|
|
|
|
const input = fs.readFileSync('../../defaults.yml', 'utf8')
|
|
|
|
const defaults = YAML.parse(input)
|
|
|
|
|
2020-09-13 19:28:38 +00:00
|
|
|
const templatesPath = 'templates'
|
|
|
|
const initialDestinationPath = 'dist-initial'
|
|
|
|
const destinationPath = 'dist'
|
|
|
|
|
|
|
|
writeHomepage({}, templatesPath, initialDestinationPath)
|
|
|
|
writeConfig({}, templatesPath,initialDestinationPath)
|
|
|
|
|
|
|
|
writeHomepage(defaults, templatesPath, destinationPath)
|
|
|
|
writeCategories(defaults, templatesPath, destinationPath)
|
|
|
|
writePages(defaults, templatesPath, destinationPath)
|
|
|
|
writeConfig(defaults, templatesPath, destinationPath)
|