Convert simple-icons manual backup from submodule to tracked files

This commit is contained in:
MayaChat
2025-11-24 14:51:23 -05:00
parent 30bbe7a0a4
commit f363db5e47
3467 changed files with 42987 additions and 1 deletions

View File

@@ -0,0 +1,33 @@
#!/usr/bin/env node
// @ts-check
/**
* @file
* Generates a MarkDown file that lists every brand name and their slug.
*/
import fs from 'node:fs/promises';
import path from 'node:path';
import {getIconSlug, getIconsData} from '../../sdk.mjs';
const rootDirectory = path.resolve(import.meta.dirname, '..', '..');
const slugsFile = path.resolve(rootDirectory, 'slugs.md');
let content = `<!--
update the script at '${path.relative(rootDirectory, import.meta.filename)}'.
-->
# Simple Icons slugs
| Brand name | Brand slug |
| :--- | :--- |
`;
const icons = await getIconsData();
for (const icon of icons) {
const brandName = icon.title;
const brandSlug = getIconSlug(icon);
content += `| \`${brandName}\` | \`${brandSlug}\` |\n`;
}
await fs.writeFile(slugsFile, content);