diff --git a/README.md b/README.md index 947a79e8..2bde7c9c 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@
- +

Soybean Admin

diff --git a/package.json b/package.json index fdfe27db..c29964f3 100644 --- a/package.json +++ b/package.json @@ -47,6 +47,7 @@ "lint": "eslint . --fix", "commit": "soybean git-commit", "esno": "esno", + "logo": "esno ./scripts/logo.ts", "cleanup": "esno ./scripts/cleanup.ts", "compress": "esno ./scripts/compress.ts", "git-hooks": "esno ./scripts/git-hooks.ts", diff --git a/public/favicon.ico b/public/favicon.ico deleted file mode 100644 index 2b47ca6e..00000000 Binary files a/public/favicon.ico and /dev/null differ diff --git a/public/logo.png b/public/logo.png index b0dbadd8..70c612d6 100644 Binary files a/public/logo.png and b/public/logo.png differ diff --git a/scripts/logo.ts b/scripts/logo.ts index 57c7a66c..08dded24 100644 --- a/scripts/logo.ts +++ b/scripts/logo.ts @@ -1,16 +1,17 @@ import { readFile } from 'fs/promises'; import nodeHtmlToImage from 'node-html-to-image'; +import themeSettings from '../src/settings/theme.json'; async function generatePngLogoFromSvg(svgPath: string, color: string) { const svgStr = await readFile(svgPath, 'utf-8'); const svgStrWithColor = svgStr.replace(/currentColor/g, color); - nodeHtmlToImage({ - output: './public/logo1.png', + await nodeHtmlToImage({ + output: './public/logo.png', html: svgStrWithColor, transparent: true }); } -generatePngLogoFromSvg('./src/assets/svg-icon/logo.svg', '#1890ff'); +generatePngLogoFromSvg('./src/assets/svg-icon/logo.svg', themeSettings.themeColor);