mirror of
https://github.com/zadam/trilium.git
synced 2026-01-06 14:44:25 +01:00
fix(icon-pack-builder): some phosphor icons not working due to alias
This commit is contained in:
parent
b997452733
commit
d9b0660def
@ -10,16 +10,21 @@ export default function buildIcons(): IconPackData {
|
|||||||
const iconIndex = JSON.parse(readFileSync(join(baseDir, "selection.json"), "utf-8"));
|
const iconIndex = JSON.parse(readFileSync(join(baseDir, "selection.json"), "utf-8"));
|
||||||
const icons: IconPackData["manifest"]["icons"] = {};
|
const icons: IconPackData["manifest"]["icons"] = {};
|
||||||
|
|
||||||
for (const icon of iconIndex.icons) {
|
function removeSuffix(name: string) {
|
||||||
let name = icon.properties.name;
|
|
||||||
if (name.endsWith(`-${packName}`)) {
|
if (name.endsWith(`-${packName}`)) {
|
||||||
name = name.split("-").slice(0, -1).join("-");
|
name = name.split("-").slice(0, -1).join("-");
|
||||||
}
|
}
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (const icon of iconIndex.icons) {
|
||||||
|
const terms = icon.properties.name.split(", ").map((t: string) => removeSuffix(t));
|
||||||
|
const name = removeSuffix(icon.icon.tags[0]);
|
||||||
|
|
||||||
const id = `ph-${name}`;
|
const id = `ph-${name}`;
|
||||||
icons[id] = {
|
icons[id] = {
|
||||||
glyph: `${String.fromCharCode(icon.properties.code)}`,
|
glyph: `${String.fromCharCode(icon.properties.code)}`,
|
||||||
terms: [ name ]
|
terms
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user