mirror of
https://github.com/Lissy93/dashy.git
synced 2025-07-28 16:14:33 +02:00
Add selfh.st/icons support
This commit is contained in:
parent
459b483a8e
commit
12372f826e
@ -72,6 +72,7 @@ export default {
|
||||
else if (img.includes('mdi-')) imgType = 'mdi';
|
||||
else if (img.includes('si-')) imgType = 'si';
|
||||
else if (img.includes('hl-')) imgType = 'home-lab-icons';
|
||||
else if (img.includes('sh-')) imgType = 'selfhst-icons';
|
||||
else if (img.includes('favicon-')) imgType = 'custom-favicon';
|
||||
else if (img === 'favicon') imgType = 'favicon';
|
||||
else if (img === 'generative') imgType = 'generative';
|
||||
@ -90,6 +91,7 @@ export default {
|
||||
case 'mdi': return img; // Material design icons
|
||||
case 'simple-icons': return this.getSimpleIcon(img);
|
||||
case 'home-lab-icons': return this.getHomeLabIcon(img);
|
||||
case 'selfhst-icons': return this.getSelfhstIcon(img); // selfh.st/icons
|
||||
case 'svg': return img; // Local SVG icon
|
||||
case 'emoji': return img; // Emoji/ unicode
|
||||
default: return '';
|
||||
@ -195,6 +197,10 @@ export default {
|
||||
}
|
||||
return icon.path;
|
||||
},
|
||||
getSelfhstIcon(img, cdn) {
|
||||
const imageName = img.slice(3).toLocaleLowerCase();
|
||||
return (cdn || iconCdns.sh).replace('{icon}', imageName);
|
||||
},
|
||||
/* Gets home-lab icon from GitHub */
|
||||
getHomeLabIcon(img, cdn) {
|
||||
const imageName = img.replace('hl-', '').toLocaleLowerCase();
|
||||
|
@ -210,6 +210,7 @@ module.exports = {
|
||||
fa: 'https://kit.fontawesome.com',
|
||||
mdi: 'https://cdn.jsdelivr.net/npm/@mdi/font@7.0.96/css/materialdesignicons.min.css',
|
||||
si: 'https://unpkg.com/simple-icons@v7/icons',
|
||||
sh: 'https://cdn.jsdelivr.net/gh/selfhst/icons@latest/webp/{icon}.webp',
|
||||
generative: 'https://api.dicebear.com/7.x/identicon/svg?seed={icon}',
|
||||
generativeFallback: 'https://evatar.io/{icon}',
|
||||
localPath: './item-icons',
|
||||
|
Loading…
x
Reference in New Issue
Block a user