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