mirror of
https://github.com/StepanovPlaton/AboutMe.git
synced 2026-07-28 19:35:51 +04:00
Cut iconify
This commit is contained in:
17
scripts/icon-inventory-include.mjs
Normal file
17
scripts/icon-inventory-include.mjs
Normal file
@@ -0,0 +1,17 @@
|
||||
import { readFileSync } from "fs";
|
||||
import { join } from "path";
|
||||
|
||||
const inventoryPath = join(import.meta.dirname, "../src/generated/icon-inventory.json");
|
||||
|
||||
export function loadIconInventory() {
|
||||
return JSON.parse(readFileSync(inventoryPath, "utf8"));
|
||||
}
|
||||
|
||||
export function toAstroIconInclude(inventory) {
|
||||
/** @type {Record<string, string[]>} */
|
||||
const include = {};
|
||||
for (const [prefix, icons] of Object.entries(inventory)) {
|
||||
include[prefix] = icons;
|
||||
}
|
||||
return include;
|
||||
}
|
||||
Reference in New Issue
Block a user