You've already forked AstralRinth
forked from didirus/AstralRinth
Add "icon" class to generated icons
This commit is contained in:
@@ -42,13 +42,16 @@ export default function Generator(options) {
|
||||
) {
|
||||
return;
|
||||
}
|
||||
if (options.landingPage) await landingPage(API_URL);
|
||||
if (options.projectColors) await projectColors(API_URL);
|
||||
if (options.gameVersions) await gameVersions(API_URL);
|
||||
|
||||
if (options.tags) await tags(API_URL);
|
||||
if (options.landingPage) await landingPage(API_URL);
|
||||
if (options.gameVersions) await gameVersions(API_URL);
|
||||
if (options.projectColors) await projectColors(API_URL);
|
||||
|
||||
// Write new state
|
||||
state.lastGenerated = new Date().toISOString();
|
||||
state.options = options;
|
||||
|
||||
await fs.writeFile('./generated/state.json', JSON.stringify(state, null, 2));
|
||||
},
|
||||
};
|
||||
|
||||
@@ -19,10 +19,15 @@ export async function tags(API_URL) {
|
||||
]);
|
||||
progressBar.update(4);
|
||||
|
||||
const tagIconReducer = (a, v) => ({
|
||||
...a,
|
||||
[v.name]: v.icon.replace('<svg', '<svg class="icon"'),
|
||||
});
|
||||
|
||||
// Create single object with icons
|
||||
const tagIcons = {
|
||||
...categories.reduce((a, v) => ({ ...a, [v.name]: v.icon }), {}),
|
||||
...loaders.reduce((a, v) => ({ ...a, [v.name]: v.icon }), {}),
|
||||
...categories.reduce(tagIconReducer, {}),
|
||||
...loaders.reduce(tagIconReducer, {}),
|
||||
};
|
||||
progressBar.increment();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user