Merge pull request #906 from simple-icons/fix/904

Update index.js filename mapping to match site
This commit is contained in:
Johan Fagerberg 2018-07-26 13:26:36 +02:00 committed by GitHub
commit 946e5aacdf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -7,7 +7,10 @@ const icons = {};
data.icons.forEach(i => {
const filename = i.title.toLowerCase()
.replace(/\+/g, "plus")
.replace(/[ .\-!]/g, '');
.replace(/^\./, "dot-")
.replace(/\.$/, "-dot")
.replace(/\./g, "-dot-")
.replace(/[ !]/g, '');
i.svg = fs.readFileSync(`${__dirname}/icons/${filename}.svg`, 'utf8');
icons[i.title] = i
});