mirror of
https://github.com/lucide-icons/lucide.git
synced 2026-12-03 16:59:42 +00:00
* fix(docs): persist icon customizer settings Persist icon color, size, stroke width, and absolute stroke width between page navigations and reloads. Keep a shared icon style state across the homepage and icons page, clamp the homepage preview size to its supported range, and apply persisted absolute stroke settings after mount. * fix(docs): avoid icon customizer hydration flicker Initialize persisted icon settings synchronously and apply absolute stroke width before the first rendered state. * fix(docs): restore icon styles before first paint Apply stored icon styles from a head script before hydration, defer customizer visibility until mount, and render persisted switches on the client to avoid stale SSR classes. Keep absolute stroke state synchronized globally and cover prepaint initialization with regression tests. * fix(site): persist icon customizer * fix(packages/react): update vulnerable @tanstack packages * fix(docs): persist icon customizer settings Persist icon color, size, stroke width, and absolute stroke width between page navigations and reloads. Keep a shared icon style state across the homepage and icons page, clamp the homepage preview size to its supported range, and apply persisted absolute stroke settings after mount. * fix(docs): avoid icon customizer hydration flicker Initialize persisted icon settings synchronously and apply absolute stroke width before the first rendered state. * fix(docs): restore icon styles before first paint Apply stored icon styles from a head script before hydration, defer customizer visibility until mount, and render persisted switches on the client to avoid stale SSR classes. Keep absolute stroke state synchronized globally and cover prepaint initialization with regression tests. * fix(site): persist icon customizer * fix(packages/react): update vulnerable @tanstack packages * fix(site): generalize usePersistedIconStyle to reduce code duplication in icon customizers * fix(site): home size slider now uses max="256", matching the sidebar * fix(site): fix linting issues in iconStyleHead.js * fix(site): make Switch.vue hydration safe * fix(site): fix home icon customizer color input width * fix(site): make home icon customizer not persistent * fix(site): fix duplicate ids in sidebar icon customizer as well * fix(site): various minor fixes to the customizer bl * fix(site): revert "[default]" placeholder --------- Co-authored-by: epifaniofrancisco <epifaniofrancisco03@gmail.com>
137 lines
3.9 KiB
TypeScript
137 lines
3.9 KiB
TypeScript
import { fileURLToPath, URL } from 'node:url';
|
|
import { defineConfig, UserConfig } from 'vitepress';
|
|
import { groupIconMdPlugin, groupIconVitePlugin } from 'vitepress-plugin-group-icons';
|
|
import sidebar from './sidebar';
|
|
import snackPlayer from './markdown/snackPlayer';
|
|
import sandpackPlugin from './markdown/sandpack';
|
|
import examplePlugin from './markdown/example';
|
|
import { readFile } from 'node:fs/promises';
|
|
import { resourcesSidebar } from './sidebar/resources';
|
|
import llmstxt from 'vitepress-plugin-llms';
|
|
import { transformPageData } from './transformPageData';
|
|
import getHeadConfig from './getHeadConfig';
|
|
|
|
const defaultSandpackCSS = await readFile(
|
|
fileURLToPath(new URL('./theme/sandpack-default.css', import.meta.url)),
|
|
'utf-8',
|
|
);
|
|
const iconStyleHeadScript = await readFile(
|
|
fileURLToPath(new URL('./theme/iconStyleHead.js', import.meta.url)),
|
|
'utf-8',
|
|
);
|
|
|
|
const title = 'Lucide';
|
|
const socialTitle = 'Lucide Icons';
|
|
const description = 'Beautiful & consistent icon toolkit made by the community.';
|
|
|
|
// https://vitepress.dev/reference/site-config
|
|
export default defineConfig({
|
|
title,
|
|
titleTemplate: ':title \u2013 Lucide',
|
|
description,
|
|
cleanUrls: true,
|
|
outDir: '.vercel/output/static',
|
|
srcExclude: ['**/README.md'],
|
|
markdown: {
|
|
config(md) {
|
|
md.use(groupIconMdPlugin);
|
|
md.use(snackPlayer);
|
|
md.use(examplePlugin);
|
|
md.use(sandpackPlugin, {
|
|
defaultFiles: {
|
|
'/styles.css': {
|
|
code: defaultSandpackCSS,
|
|
hidden: true,
|
|
},
|
|
},
|
|
});
|
|
},
|
|
},
|
|
vite: {
|
|
resolve: {
|
|
alias: [
|
|
{
|
|
find: /^.*\/VPIconAlignLeft\.vue$/,
|
|
replacement: fileURLToPath(
|
|
new URL('./theme/components/overrides/VPIconAlignLeft.vue', import.meta.url),
|
|
),
|
|
},
|
|
{
|
|
find: /^.*\/VPFooter\.vue$/,
|
|
replacement: fileURLToPath(
|
|
new URL('./theme/components/overrides/VPFooter.vue', import.meta.url),
|
|
),
|
|
},
|
|
{
|
|
find: /^.*\/VPCarbonAds\.vue$/,
|
|
replacement: fileURLToPath(
|
|
new URL('./theme/components/overrides/VPCarbonAds.vue', import.meta.url),
|
|
),
|
|
},
|
|
{
|
|
find: '~/.vitepress',
|
|
replacement: fileURLToPath(new URL('./', import.meta.url)),
|
|
},
|
|
],
|
|
},
|
|
plugins: [
|
|
groupIconVitePlugin(),
|
|
llmstxt({
|
|
ignoreFiles: [
|
|
'code-of-conduct.md',
|
|
'index.md',
|
|
'packages.md',
|
|
'showcase.md',
|
|
'brand-logo-statement.md',
|
|
'icons/**', // Not working, need investigation
|
|
],
|
|
}) as unknown as UserConfig['vite']['plugins'][0],
|
|
],
|
|
},
|
|
head: [
|
|
...getHeadConfig({ title, description, socialTitle }),
|
|
['script', {}, iconStyleHeadScript],
|
|
],
|
|
transformPageData,
|
|
themeConfig: {
|
|
logo: {
|
|
light: '/logo.light.svg',
|
|
dark: '/logo.dark.svg',
|
|
},
|
|
nav: [
|
|
{ text: 'Icons', link: '/icons/' },
|
|
{ text: 'Guide', link: '/guide/' },
|
|
{
|
|
text: 'Resources',
|
|
items: [
|
|
...resourcesSidebar[0].items.map(({ text, link }) => ({ text, link })),
|
|
{ text: 'How to use icons', link: '/how-to/' },
|
|
{ text: 'Contributing icons', link: '/contribute/icons/' },
|
|
],
|
|
},
|
|
{ text: 'Packages', link: '/packages' },
|
|
{ text: 'Showcase', link: '/showcase' },
|
|
{ text: 'Merch', link: 'https://merch.lucide.dev/' },
|
|
],
|
|
sidebar,
|
|
socialLinks: [
|
|
{ icon: 'github', link: 'https://github.com/lucide-icons/lucide' },
|
|
{ icon: 'discord', link: 'https://discord.gg/EH6nSts' },
|
|
],
|
|
footer: {
|
|
message: 'Released under the ISC License.',
|
|
copyright: `Copyright © ${new Date().getFullYear()} Lucide Icons`,
|
|
},
|
|
editLink: {
|
|
pattern: 'https://github.com/lucide-icons/lucide/edit/main/docs/:path',
|
|
},
|
|
carbonAds: {
|
|
code: 'CWYIC53U',
|
|
placement: 'lucidedev',
|
|
},
|
|
},
|
|
sitemap: {
|
|
hostname: 'https://lucide.dev/',
|
|
},
|
|
});
|