2017-09-16 23:49:58 +03:00
|
|
|
|
const dataFile = './_data/simple-icons.json';
|
|
|
|
|
const data = require(dataFile);
|
|
|
|
|
const fs = require('fs');
|
|
|
|
|
|
2017-09-17 04:48:02 +03:00
|
|
|
|
const icons = {};
|
2017-09-16 23:49:58 +03:00
|
|
|
|
|
|
|
|
|
data.icons.forEach(i => {
|
2017-09-17 04:48:02 +03:00
|
|
|
|
const filename = i.title.toLowerCase()
|
|
|
|
|
.replace(/\+/g, "plus")
|
2018-07-26 13:56:00 +03:00
|
|
|
|
.replace(/^\./, "dot-")
|
|
|
|
|
.replace(/\.$/, "-dot")
|
|
|
|
|
.replace(/\./g, "-dot-")
|
|
|
|
|
.replace(/[ !’]/g, '');
|
2017-09-17 05:46:33 +03:00
|
|
|
|
i.svg = fs.readFileSync(`${__dirname}/icons/${filename}.svg`, 'utf8');
|
2017-09-17 04:48:02 +03:00
|
|
|
|
icons[i.title] = i
|
2017-09-16 23:49:58 +03:00
|
|
|
|
});
|
|
|
|
|
|
2017-09-17 04:48:02 +03:00
|
|
|
|
module.exports = icons;
|