2026-06-13 15:25:41 +02:00
|
|
|
import * as iconDetails from '../.vitepress/data/iconDetails';
|
2023-06-04 16:59:38 +02:00
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
async load() {
|
|
|
|
|
return {
|
2026-09-18 14:22:47 +02:00
|
|
|
icons: Object.entries(iconDetails)
|
|
|
|
|
.map(
|
|
|
|
|
([
|
|
|
|
|
,
|
|
|
|
|
{ name, iconNode, popularity, createdRelease, awaitingRelease, aliases = [], fromFork },
|
|
|
|
|
]) => ({
|
|
|
|
|
name,
|
|
|
|
|
iconNode,
|
|
|
|
|
popularity: popularity?.count ?? 0,
|
|
|
|
|
aliases: aliases
|
|
|
|
|
.map((alias) => (typeof alias === 'string' ? alias : alias?.name))
|
|
|
|
|
.filter((alias): alias is string => Boolean(alias)),
|
|
|
|
|
createdRelease,
|
|
|
|
|
awaitingRelease,
|
|
|
|
|
fromFork,
|
|
|
|
|
}),
|
|
|
|
|
// We hide icons that are not released yet, we make exceptions for preview environments
|
|
|
|
|
)
|
|
|
|
|
.filter(
|
|
|
|
|
({ awaitingRelease }) =>
|
|
|
|
|
!awaitingRelease || process.env.VITE_SHOW_AWAITING_RELEASE === 'true',
|
|
|
|
|
),
|
2024-02-01 22:38:21 +09:00
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
};
|