forked from osmlab/osm-community-index
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build_icons.js
50 lines (43 loc) · 1.79 KB
/
build_icons.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/* eslint-disable no-console */
const colors = require('colors/safe');
const fs = require('fs');
const fontawesome = require('@fortawesome/fontawesome');
const faAt = require('@fortawesome/fontawesome-free-solid/faAt');
const faComments = require('@fortawesome/fontawesome-free-solid/faComments');
const faDiscord = require('@fortawesome/fontawesome-free-brands/faDiscord');
const faDiscourse = require('@fortawesome/fontawesome-free-brands/faDiscourse');
const faFacebook = require('@fortawesome/fontawesome-free-brands/faFacebook');
const faKeyboard = require('@fortawesome/fontawesome-free-solid/faKeyboard');
const faMeetup = require('@fortawesome/fontawesome-free-brands/faMeetup');
const faReddit = require('@fortawesome/fontawesome-free-brands/faReddit');
const faSlack = require('@fortawesome/fontawesome-free-brands/faSlack');
const faTelegram = require('@fortawesome/fontawesome-free-brands/faTelegram');
const faTwitter = require('@fortawesome/fontawesome-free-brands/faTwitter');
const faUsers = require('@fortawesome/fontawesome-free-solid/faUsers');
buildAll();
function buildAll() {
var iconMap = {
discord: faDiscord,
discourse: faDiscourse,
facebook: faFacebook,
forum: faComments,
group: faUsers,
irc: faKeyboard,
mailinglist: faAt,
matrix: faComments,
meetup: faMeetup,
reddit: faReddit,
slack: faSlack,
telegram: faTelegram,
twitter: faTwitter
};
console.log('building icons');
console.time(colors.green('icons built'));
for (var key in iconMap) {
var val = iconMap[key];
var file = 'dist/img/' + key + '.svg';
console.log(colors.yellow(file));
fs.writeFileSync(file, fontawesome.icon(val).html);
}
console.timeEnd(colors.green('icons built'));
}