Fix icon count (#5358)

This commit is contained in:
Eric Fennis
2026-12-02 10:35:27 +01:00
committed by GitHub
parent 5cbcb7e3f7
commit 25d9ddaa0c
5 changed files with 21 additions and 10 deletions
+13
View File
@@ -0,0 +1,13 @@
import * as iconDetails from '../data/iconDetails/index.ts';
/**
* Icons that are not released yet are hidden, except on preview environments
* where `VITE_SHOW_AWAITING_RELEASE` is set.
*/
export const isVisibleIcon = ({ awaitingRelease }: { awaitingRelease?: boolean }) =>
!awaitingRelease || process.env.VITE_SHOW_AWAITING_RELEASE === 'true';
/**
* Number of icons shown on the site, matching the latest release.
*/
export const getReleasedIconCount = () => Object.values(iconDetails).filter(isVisibleIcon).length;
@@ -1,4 +1,5 @@
import iconNodes from '../../../data/iconNodes/index.ts';
import { getReleasedIconCount } from '../../../lib/releasedIcons.ts';
const pickIcons = [
'bot',
@@ -92,7 +93,7 @@ const loader = {
return {
icons: selectedIcons,
iconsCount: icons.length,
iconsCount: getReleasedIconCount(),
};
},
};
@@ -1,5 +1,5 @@
import iconNodes from '../../../data/iconNodes/index.ts';
import fetchPackages from '../../../lib/fetchPackages.ts';
import { getReleasedIconCount } from '../../../lib/releasedIcons.ts';
const NPM_DOWNLOADS_API = 'https://api.npmjs.org/downloads/point/last-week';
@@ -71,7 +71,7 @@ const loader = {
return {
stars,
weeklyDownloads,
iconsCount: Object.keys(iconNodes).length,
iconsCount: getReleasedIconCount(),
};
},
};
+2 -2
View File
@@ -1,13 +1,13 @@
---
title: What is Lucide?
description: An introduction to Lucide, an open-source icon library that provides 1600+ vector (svg) files for displaying icons and symbols in digital and non-digital projects.
description: An introduction to Lucide, an open-source icon library that provides 2000+ vector (svg) files for displaying icons and symbols in digital and non-digital projects.
nextPage:
- installation
---
# What is Lucide?
Lucide is an open-source icon library that provides 1600+ vector (svg) files for displaying icons and symbols in digital and non-digital projects. The library aims to make it easier for designers and developers to incorporate icons into their projects by providing several official [packages](/packages).
Lucide is an open-source icon library that provides 2000+ vector (svg) files for displaying icons and symbols in digital and non-digital projects. The library aims to make it easier for designers and developers to incorporate icons into their projects by providing several official [packages](/packages).
## Available Icons
+2 -5
View File
@@ -1,4 +1,5 @@
import * as iconDetails from '../.vitepress/data/iconDetails/index.ts';
import { isVisibleIcon } from '../.vitepress/lib/releasedIcons.ts';
export default {
async load() {
@@ -19,12 +20,8 @@ export default {
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',
),
.filter(isVisibleIcon),
};
},
};