develop
HerrHase 1 year ago
parent 6ad6d7fda1
commit 0e263549c4

@ -0,0 +1,6 @@
posts:
orderBy:
- '-date_published'
filter:
view:
_eq: 'post.njk'

@ -56,6 +56,11 @@ class Siteomat {
throw new Error('site.yml not found in ' + this._source + '!')
}
if (fs.existsSync(this._source + '/json.yml')) {
const file = fs.readFileSync(this._source + '/json.yml', 'utf8')
this._json = parseYamlFile(file)
}
configStore.set('site', this._site)
this._engine = new Engine(views, this._site)
@ -100,7 +105,14 @@ class Siteomat {
})
})
if (this._json) {
for (const [name, options] of Object.entries(this._json)) {
const json = query.find(options)
fs.writeFileSync(this._destination + '/' + name + '.json', JSON.stringify(json))
}
}
}
}
module.exports = Siteomat
module.exports = Siteomat

Loading…
Cancel
Save