mirror of
https://github.com/learnk8s/learnk8s.io.git
synced 2026-02-14 16:39:52 +00:00
remove unused svgo.js
This commit is contained in:
@@ -1,28 +0,0 @@
|
||||
const shell = require('shelljs');
|
||||
const cheerio = require('cheerio');
|
||||
|
||||
shell.ls('*.svg').forEach(svg => {
|
||||
const fileName = svg.slice(0, -4);
|
||||
const $ = cheerio.load(shell.cat(svg).toString(), {decodeEntities: false});
|
||||
$('[id]').each((i, element) => {
|
||||
const id = $(element).attr('id');
|
||||
if (new RegExp(`^${fileName}-animejs`, 'i').test(id)) {
|
||||
return;
|
||||
}
|
||||
if (!/^animejs/i.test(id)) {
|
||||
$(element).attr('id', null);
|
||||
} else {
|
||||
$(element).attr('id', `${fileName}-${id}`);
|
||||
}
|
||||
});
|
||||
$('svg').attr('width', null);
|
||||
$('svg').attr('height', null);
|
||||
$('svg').attr('id', fileName);
|
||||
$('[font-family="Arial-BoldMT, Arial"]').each(updateFonts);
|
||||
$('[font-family="ArialMT, Arial"]').each(updateFonts);
|
||||
shell.ShellString($('body').html()).to(svg);
|
||||
|
||||
function updateFonts(index, element) {
|
||||
$(element).attr('font-family', `-apple-system, BlinkMacSystemFont, 'avenir next', avenir, 'helvetica neue', helvetica, ubuntu, roboto, noto, 'segoe ui', arial, sans-serif`)
|
||||
}
|
||||
});
|
||||
@@ -1,36 +0,0 @@
|
||||
const shell = require('shelljs');
|
||||
const cheerio = require('cheerio');
|
||||
|
||||
shell.ls('*.svg').forEach(svg => {
|
||||
const fileName = svg.slice(0, -4);
|
||||
const $ = cheerio.load(shell.cat(svg).toString(), {decodeEntities: false});
|
||||
const skipIds = []
|
||||
$('[fill]').each((index, element) => {
|
||||
const fill = $(element).attr('fill');
|
||||
if (fill.startsWith('url(#')) {
|
||||
skipIds.push(fill.substring(5, fill.length - 1))
|
||||
}
|
||||
});
|
||||
$('[id]').each((i, element) => {
|
||||
const id = $(element).attr('id');
|
||||
if (skipIds.includes(id)) {
|
||||
return;
|
||||
}
|
||||
if (new RegExp(`^${fileName}-animejs`, 'i').test(id)) {
|
||||
return;
|
||||
}
|
||||
if (!/^animejs/i.test(id)) {
|
||||
$(element).attr('id', null);
|
||||
} else {
|
||||
$(element).attr('id', `${fileName}-${id}`);
|
||||
}
|
||||
});
|
||||
$('svg').attr('width', null);
|
||||
$('svg').attr('height', null);
|
||||
$('svg').attr('id', fileName);
|
||||
$('[font-family]').each((index, element) => {
|
||||
$(element).attr('font-family', null)
|
||||
$(element).addClass('sans-serif')
|
||||
});
|
||||
shell.ShellString($('body').html()).to(svg);
|
||||
});
|
||||
@@ -1,36 +0,0 @@
|
||||
const shell = require('shelljs');
|
||||
const cheerio = require('cheerio');
|
||||
|
||||
shell.ls('*.svg').forEach(svg => {
|
||||
const fileName = svg.slice(0, -4);
|
||||
const $ = cheerio.load(shell.cat(svg).toString(), {decodeEntities: false});
|
||||
const skipIds = []
|
||||
$('[fill]').each((index, element) => {
|
||||
const fill = $(element).attr('fill');
|
||||
if (fill.startsWith('url(#')) {
|
||||
skipIds.push(fill.substring(5, fill.length - 1))
|
||||
}
|
||||
});
|
||||
$('[id]').each((i, element) => {
|
||||
const id = $(element).attr('id');
|
||||
if (skipIds.includes(id)) {
|
||||
return;
|
||||
}
|
||||
if (new RegExp(`^${fileName}-animejs`, 'i').test(id)) {
|
||||
return;
|
||||
}
|
||||
if (!/^animejs/i.test(id)) {
|
||||
$(element).attr('id', null);
|
||||
} else {
|
||||
$(element).attr('id', `${fileName}-${id}`);
|
||||
}
|
||||
});
|
||||
$('svg').attr('width', null);
|
||||
$('svg').attr('height', null);
|
||||
$('svg').attr('id', fileName);
|
||||
$('[font-family]').each((index, element) => {
|
||||
$(element).attr('font-family', null)
|
||||
$(element).addClass('sans-serif')
|
||||
});
|
||||
shell.ShellString($('body').html()).to(svg);
|
||||
});
|
||||
@@ -1,36 +0,0 @@
|
||||
const shell = require('shelljs');
|
||||
const cheerio = require('cheerio');
|
||||
|
||||
shell.ls('*.svg').forEach(svg => {
|
||||
const fileName = svg.slice(0, -4);
|
||||
const $ = cheerio.load(shell.cat(svg).toString(), {decodeEntities: false});
|
||||
const skipIds = []
|
||||
$('[fill]').each((index, element) => {
|
||||
const fill = $(element).attr('fill');
|
||||
if (fill.startsWith('url(#')) {
|
||||
skipIds.push(fill.substring(5, fill.length - 1))
|
||||
}
|
||||
});
|
||||
$('[id]').each((i, element) => {
|
||||
const id = $(element).attr('id');
|
||||
if (skipIds.includes(id)) {
|
||||
return;
|
||||
}
|
||||
if (new RegExp(`^${fileName}-animejs`, 'i').test(id)) {
|
||||
return;
|
||||
}
|
||||
if (!/^animejs/i.test(id)) {
|
||||
$(element).attr('id', null);
|
||||
} else {
|
||||
$(element).attr('id', `${fileName}-${id}`);
|
||||
}
|
||||
});
|
||||
$('svg').attr('width', null);
|
||||
$('svg').attr('height', null);
|
||||
$('svg').attr('id', fileName);
|
||||
$('[font-family]').each((index, element) => {
|
||||
$(element).attr('font-family', null)
|
||||
$(element).addClass('sans-serif')
|
||||
});
|
||||
shell.ShellString($('body').html()).to(svg);
|
||||
});
|
||||
@@ -1,36 +0,0 @@
|
||||
const shell = require('shelljs');
|
||||
const cheerio = require('cheerio');
|
||||
|
||||
shell.ls('*.svg').forEach(svg => {
|
||||
const fileName = svg.slice(0, -4);
|
||||
const $ = cheerio.load(shell.cat(svg).toString(), {decodeEntities: false});
|
||||
const skipIds = []
|
||||
$('[fill]').each((index, element) => {
|
||||
const fill = $(element).attr('fill');
|
||||
if (fill.startsWith('url(#')) {
|
||||
skipIds.push(fill.substring(5, fill.length - 1))
|
||||
}
|
||||
});
|
||||
$('[id]').each((i, element) => {
|
||||
const id = $(element).attr('id');
|
||||
if (skipIds.includes(id)) {
|
||||
return;
|
||||
}
|
||||
if (new RegExp(`^${fileName}-animejs`, 'i').test(id)) {
|
||||
return;
|
||||
}
|
||||
if (!/^animejs/i.test(id)) {
|
||||
$(element).attr('id', null);
|
||||
} else {
|
||||
$(element).attr('id', `${fileName}-${id}`);
|
||||
}
|
||||
});
|
||||
$('svg').attr('width', null);
|
||||
$('svg').attr('height', null);
|
||||
$('svg').attr('id', fileName);
|
||||
$('[font-family]').each((index, element) => {
|
||||
$(element).attr('font-family', null)
|
||||
$(element).addClass('sans-serif')
|
||||
});
|
||||
shell.ShellString($('body').html()).to(svg);
|
||||
});
|
||||
@@ -1,36 +0,0 @@
|
||||
const shell = require('shelljs');
|
||||
const cheerio = require('cheerio');
|
||||
|
||||
shell.ls('*.svg').forEach(svg => {
|
||||
const fileName = svg.slice(0, -4);
|
||||
const $ = cheerio.load(shell.cat(svg).toString(), {decodeEntities: false});
|
||||
const skipIds = []
|
||||
$('[fill]').each((index, element) => {
|
||||
const fill = $(element).attr('fill');
|
||||
if (fill.startsWith('url(#')) {
|
||||
skipIds.push(fill.substring(5, fill.length - 1))
|
||||
}
|
||||
});
|
||||
$('[id]').each((i, element) => {
|
||||
const id = $(element).attr('id');
|
||||
if (skipIds.includes(id)) {
|
||||
return;
|
||||
}
|
||||
if (new RegExp(`^${fileName}-animejs`, 'i').test(id)) {
|
||||
return;
|
||||
}
|
||||
if (!/^animejs/i.test(id)) {
|
||||
$(element).attr('id', null);
|
||||
} else {
|
||||
$(element).attr('id', `${fileName}-${id}`);
|
||||
}
|
||||
});
|
||||
$('svg').attr('width', null);
|
||||
$('svg').attr('height', null);
|
||||
$('svg').attr('id', fileName);
|
||||
$('[font-family]').each((index, element) => {
|
||||
$(element).attr('font-family', null)
|
||||
$(element).addClass('sans-serif')
|
||||
});
|
||||
shell.ShellString($('body').html()).to(svg);
|
||||
});
|
||||
Reference in New Issue
Block a user