mirror of
https://github.com/lucide-icons/lucide.git
synced 2026-12-03 16:59:42 +00:00
Fix icon count (#5358)
This commit is contained in:
@@ -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
@@ -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
|
||||
|
||||
|
||||
@@ -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),
|
||||
};
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user