ÖzgürKon 2021
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ozgurkon-2021-site/tools/extract-data.js

24 lines
556 B

6 years ago
const yaml = require('js-yaml');
const fs = require('fs');
const path = require('path');
6 years ago
const writeOption = {
flag: 'w'
6 years ago
};
6 years ago
const writeToYml = (list, dest) => {
const data = yaml.safeDump(list);
6 years ago
console.log('Write to', dest);
6 years ago
fs.writeFileSync(dest, data, writeOption);
6 years ago
};
6 years ago
const firebaseData = require('./firebase-data.json');
6 years ago
6 years ago
['partners', 'team', 'tickets']
.forEach(key => {
6 years ago
const dest = path.join(__dirname, `../test-hugo/data/${key}.yml`);
6 years ago
const data = firebaseData[key];
6 years ago
writeToYml(data, dest);
});