1
0
mirror of https://github.com/tabler/tabler.git synced 2025-12-22 01:44:25 +04:00

tabler icons demo

This commit is contained in:
codecalm
2020-04-20 21:56:47 +02:00
parent cef66d41cb
commit 6c0950638f
11 changed files with 2382 additions and 1606 deletions

View File

@@ -6,11 +6,11 @@ const gulp = require('gulp'),
cp = require('child_process');
const prepareSvgFile = function(svg) {
return svg.replace(/\n/g, '');
return svg.replace(/\n/g, '').replace(/>\s+</g, '><');
};
gulp.task('svg-icons', function (cb) {
const files = glob.sync("./node_modules/tabler-icons/icons/*.svg");
const generateIconsYml = function(dir, filename) {
const files = glob.sync(dir);
let svgList = {};
files.forEach(function(file){
@@ -18,6 +18,11 @@ gulp.task('svg-icons', function (cb) {
svgList[basename] = prepareSvgFile(fs.readFileSync(file).toString());
});
fs.writeFileSync('./pages/_data/icons-tabler.yml', YAML.stringify(svgList));
fs.writeFileSync(filename, YAML.stringify(svgList));
};
gulp.task('svg-icons', function (cb) {
generateIconsYml("./node_modules/tabler-icons/icons/*.svg", './pages/_data/icons-tabler.yml');
generateIconsYml("./svg/brand/*.svg", './pages/_data/icons-brand.yml');
cb();
});