From 08a88440ba66c0b50324430373ed9d2b0f69db3f Mon Sep 17 00:00:00 2001 From: yanrudykh <157956496+yanrudykh@users.noreply.github.com> Date: Fri, 1 Nov 2024 18:56:33 +1000 Subject: [PATCH 01/46] Translation fix (#4328) --- docs/ru/guide/asset-handling.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/ru/guide/asset-handling.md b/docs/ru/guide/asset-handling.md index 3b002e13..7236e32d 100644 --- a/docs/ru/guide/asset-handling.md +++ b/docs/ru/guide/asset-handling.md @@ -8,7 +8,7 @@ ![Изображение](./image.png) ``` -Вы можете ссылаться на статические ресурсы в ваших файлах разметки, компоненты `*.vue` в теме, стили и обычные файлы `.css`, используя абсолютные пути (основанные на корне проекта) или относительные пути (основанные на вашей файловой системе). Последнее похоже на поведение, к которому вы привыкли, если использовали Vite, Vue CLI или `file-loader` в webpack. +Вы можете ссылаться на статические ресурсы в ваших файлах разметки, ваших компонентах `*.vue` в теме, стилях и обычных файлах `.css`, используя абсолютные пути (основанные на корне проекта) или относительные пути (основанные на вашей файловой системе). Последнее похоже на поведение, к которому вы привыкли, если использовали Vite, Vue CLI или `file-loader` в webpack. Распространённые типы файлов изображений, мультимедиа и шрифтов определяются и включаются в качестве ресурсов автоматически. From dcb8450f1166d7731c26a0eb5ec6d931bc283172 Mon Sep 17 00:00:00 2001 From: Divyansh Singh <40380293+brc-dd@users.noreply.github.com> Date: Sun, 3 Nov 2024 14:30:31 +0530 Subject: [PATCH 02/46] fix: typo in missing language check --- src/node/markdown/plugins/highlight.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/node/markdown/plugins/highlight.ts b/src/node/markdown/plugins/highlight.ts index 4afe83cc..0ae9ed75 100644 --- a/src/node/markdown/plugins/highlight.ts +++ b/src/node/markdown/plugins/highlight.ts @@ -120,7 +120,7 @@ export async function highlight( const langLoaded = highlighter.getLoadedLanguages().includes(lang) if (!langLoaded && !isSpecialLang(lang)) { const resolvedLang = resolveLangSync(lang) - if (!resolvedLang) { + if (!resolvedLang.length) { logger.warn( c.yellow( `\nThe language '${lang}' is not loaded, falling back to '${ From 4dac35fc9ec3eecb4371befa619626ee4db1ba58 Mon Sep 17 00:00:00 2001 From: Divyansh Singh <40380293+brc-dd@users.noreply.github.com> Date: Sun, 3 Nov 2024 17:09:29 +0530 Subject: [PATCH 03/46] fix: (temporary patch) lang lazy load not working with twoslash --- src/node/cli.ts | 6 ++- src/node/markdown/plugins/highlight.ts | 52 ++++++++++++++++---------- src/node/worker_shikiResolveLang.ts | 8 +++- 3 files changed, 43 insertions(+), 23 deletions(-) diff --git a/src/node/cli.ts b/src/node/cli.ts index fb60c6f6..6b7f977c 100644 --- a/src/node/cli.ts +++ b/src/node/cli.ts @@ -2,10 +2,14 @@ import minimist from 'minimist' import c from 'picocolors' import { createLogger } from 'vite' import { build, createServer, serve } from '.' -import { init } from './init/init' import { version } from '../../package.json' +import { init } from './init/init' import { bindShortcuts } from './shortcuts' +if (process.env.DEBUG) { + Error.stackTraceLimit = Infinity +} + const argv: any = minimist(process.argv.slice(2)) const logVersion = (logger = createLogger()) => { diff --git a/src/node/markdown/plugins/highlight.ts b/src/node/markdown/plugins/highlight.ts index 0ae9ed75..5e0abf28 100644 --- a/src/node/markdown/plugins/highlight.ts +++ b/src/node/markdown/plugins/highlight.ts @@ -9,7 +9,7 @@ import { import { customAlphabet } from 'nanoid' import { createRequire } from 'node:module' import c from 'picocolors' -import type { ShikiTransformer } from 'shiki' +import type { LanguageRegistration, ShikiTransformer } from 'shiki' import { createHighlighter, isSpecialLang } from 'shiki' import { createSyncFn } from 'synckit' import type { Logger } from 'vite' @@ -61,10 +61,14 @@ export async function highlight( logger: Pick = console ): Promise<[(str: string, lang: string, attrs: string) => string, () => void]> { const { - defaultHighlightLang: defaultLang = '', + defaultHighlightLang: defaultLang = 'txt', codeTransformers: userTransformers = [] } = options + const usingTwoslash = userTransformers.some( + ({ name }) => name === '@shikijs/vitepress-twoslash' + ) + const highlighter = await createHighlighter({ themes: typeof theme === 'object' && 'light' in theme && 'dark' in theme @@ -72,11 +76,29 @@ export async function highlight( : [theme], langs: [ ...(options.languages || []), - ...Object.values(options.languageAlias || {}) + ...Object.values(options.languageAlias || {}), + + // patch for twoslash - https://github.com/vuejs/vitepress/issues/4334 + ...(usingTwoslash + ? Object.keys((await import('shiki')).bundledLanguages) + : []) ], langAlias: options.languageAlias }) + function loadLanguage(name: string | LanguageRegistration) { + const lang = typeof name === 'string' ? name : name.name + if ( + !isSpecialLang(lang) && + !highlighter.getLoadedLanguages().includes(lang) + ) { + const resolvedLang = resolveLangSync(lang) + if (resolvedLang.length) highlighter.loadLanguageSync(resolvedLang) + else return false + } + return true + } + await options?.shikiSetup?.(highlighter) const transformers: ShikiTransformer[] = [ @@ -116,23 +138,13 @@ export async function highlight( .replace(vueRE, '') .toLowerCase() || defaultLang - if (lang) { - const langLoaded = highlighter.getLoadedLanguages().includes(lang) - if (!langLoaded && !isSpecialLang(lang)) { - const resolvedLang = resolveLangSync(lang) - if (!resolvedLang.length) { - logger.warn( - c.yellow( - `\nThe language '${lang}' is not loaded, falling back to '${ - defaultLang || 'txt' - }' for syntax highlighting.` - ) - ) - lang = defaultLang - } else { - highlighter.loadLanguageSync(resolvedLang) - } - } + if (!loadLanguage(lang)) { + logger.warn( + c.yellow( + `\nThe language '${lang}' is not loaded, falling back to '${defaultLang}' for syntax highlighting.` + ) + ) + lang = defaultLang } const lineOptions = attrsToLines(attrs) diff --git a/src/node/worker_shikiResolveLang.ts b/src/node/worker_shikiResolveLang.ts index 22a2c228..644caf9e 100644 --- a/src/node/worker_shikiResolveLang.ts +++ b/src/node/worker_shikiResolveLang.ts @@ -1,4 +1,8 @@ -import { bundledLanguages, type DynamicImportLanguageRegistration } from 'shiki' +import { + bundledLanguages, + type DynamicImportLanguageRegistration, + type LanguageRegistration +} from 'shiki' import { runAsWorker } from 'synckit' async function resolveLang(lang: string) { @@ -10,7 +14,7 @@ async function resolveLang(lang: string) { > ) [lang]?.() - .then((m) => m.default) || [] + .then((m) => m.default) || ([] as LanguageRegistration[]) ) } From 11eb13756506e021f14b20005813b899bde9e19e Mon Sep 17 00:00:00 2001 From: Divyansh Singh <40380293+brc-dd@users.noreply.github.com> Date: Sun, 3 Nov 2024 17:12:52 +0530 Subject: [PATCH 04/46] release: v1.4.4 --- CHANGELOG.md | 7 +++++++ package.json | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 014c4c6c..e8a31b25 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## [1.4.4](https://github.com/vuejs/vitepress/compare/v1.4.3...v1.4.4) (2024-11-03) + +### Bug Fixes + +- (temporary patch) lang lazy load not working with twoslash ([4dac35f](https://github.com/vuejs/vitepress/commit/4dac35fc9ec3eecb4371befa619626ee4db1ba58)) +- typo in missing language check ([dcb8450](https://github.com/vuejs/vitepress/commit/dcb8450f1166d7731c26a0eb5ec6d931bc283172)) + ## [1.4.3](https://github.com/vuejs/vitepress/compare/v1.4.2...v1.4.3) (2024-10-31) ### Performance Improvements diff --git a/package.json b/package.json index 482d015f..9d1fb1aa 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vitepress", - "version": "1.4.3", + "version": "1.4.4", "description": "Vite & Vue powered static site generator", "keywords": [ "vite", From fc92a77a5d871b5252bcb82639f5c3551d5c70bb Mon Sep 17 00:00:00 2001 From: Divyansh Singh <40380293+brc-dd@users.noreply.github.com> Date: Sun, 3 Nov 2024 18:07:34 +0530 Subject: [PATCH 05/46] fix: lazy load language definition on twoslash too closes #4334 --- src/node/markdown/plugins/highlight.ts | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/node/markdown/plugins/highlight.ts b/src/node/markdown/plugins/highlight.ts index 5e0abf28..12852caf 100644 --- a/src/node/markdown/plugins/highlight.ts +++ b/src/node/markdown/plugins/highlight.ts @@ -65,10 +65,6 @@ export async function highlight( codeTransformers: userTransformers = [] } = options - const usingTwoslash = userTransformers.some( - ({ name }) => name === '@shikijs/vitepress-twoslash' - ) - const highlighter = await createHighlighter({ themes: typeof theme === 'object' && 'light' in theme && 'dark' in theme @@ -76,12 +72,7 @@ export async function highlight( : [theme], langs: [ ...(options.languages || []), - ...Object.values(options.languageAlias || {}), - - // patch for twoslash - https://github.com/vuejs/vitepress/issues/4334 - ...(usingTwoslash - ? Object.keys((await import('shiki')).bundledLanguages) - : []) + ...Object.values(options.languageAlias || {}) ], langAlias: options.languageAlias }) @@ -99,6 +90,14 @@ export async function highlight( return true } + // patch for twoslash - https://github.com/vuejs/vitepress/issues/4334 + const internal = highlighter.getInternalContext() + const getLanguage = internal.getLanguage + internal.getLanguage = (name) => { + loadLanguage(name) + return getLanguage.call(internal, name) + } + await options?.shikiSetup?.(highlighter) const transformers: ShikiTransformer[] = [ From 1e4917eb309a69c99022d6b56c8ec08d64f2e995 Mon Sep 17 00:00:00 2001 From: Divyansh Singh <40380293+brc-dd@users.noreply.github.com> Date: Sun, 3 Nov 2024 18:11:12 +0530 Subject: [PATCH 06/46] release: v1.4.5 --- CHANGELOG.md | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e8a31b25..4cc58d57 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,8 @@ -## [1.4.4](https://github.com/vuejs/vitepress/compare/v1.4.3...v1.4.4) (2024-11-03) +## [1.4.5](https://github.com/vuejs/vitepress/compare/v1.4.4...v1.4.5) (2024-11-03) ### Bug Fixes -- (temporary patch) lang lazy load not working with twoslash ([4dac35f](https://github.com/vuejs/vitepress/commit/4dac35fc9ec3eecb4371befa619626ee4db1ba58)) +- lang lazy load not working with twoslash ([fc92a77](https://github.com/vuejs/vitepress/commit/fc92a77a5d871b5252bcb82639f5c3551d5c70bb)), closes [#4334](https://github.com/vuejs/vitepress/issues/4334) - typo in missing language check ([dcb8450](https://github.com/vuejs/vitepress/commit/dcb8450f1166d7731c26a0eb5ec6d931bc283172)) ## [1.4.3](https://github.com/vuejs/vitepress/compare/v1.4.2...v1.4.3) (2024-10-31) diff --git a/package.json b/package.json index 9d1fb1aa..b486493c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vitepress", - "version": "1.4.4", + "version": "1.4.5", "description": "Vite & Vue powered static site generator", "keywords": [ "vite", From 602ae7ba9d27dfc6a55793e62efc936fd0859c2e Mon Sep 17 00:00:00 2001 From: Aether Chen <15167799+chenjunyu19@users.noreply.github.com> Date: Mon, 4 Nov 2024 00:34:30 +0800 Subject: [PATCH 07/46] chore: remove redundant spaces in theme template css (#4337) --- template/.vitepress/theme/style.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/template/.vitepress/theme/style.css b/template/.vitepress/theme/style.css index a72e96e6..12ae89a4 100644 --- a/template/.vitepress/theme/style.css +++ b/template/.vitepress/theme/style.css @@ -8,7 +8,7 @@ * * Each colors have exact same color scale system with 3 levels of solid * colors with different brightness, and 1 soft color. - * + * * - `XXX-1`: The most solid color used mainly for colored text. It must * satisfy the contrast ratio against when used on top of `XXX-soft`. * @@ -43,7 +43,7 @@ * in custom container, badges, etc. * -------------------------------------------------------------------------- */ - :root { +:root { --vp-c-default-1: var(--vp-c-gray-1); --vp-c-default-2: var(--vp-c-gray-2); --vp-c-default-3: var(--vp-c-gray-3); From 05f2f0d26153ace74b6c023184224d4fada137c2 Mon Sep 17 00:00:00 2001 From: Divyansh Singh <40380293+brc-dd@users.noreply.github.com> Date: Mon, 4 Nov 2024 21:02:31 +0530 Subject: [PATCH 08/46] feat: on demand social icons (#4339) --- docs/en/reference/default-theme-config.md | 17 +-- docs/es/reference/default-theme-config.md | 16 +-- docs/ko/reference/default-theme-config.md | 16 +-- docs/pt/reference/default-theme-config.md | 16 +-- docs/ru/reference/default-theme-config.md | 16 +-- docs/zh/reference/default-theme-config.md | 16 +-- package.json | 2 + pnpm-lock.yaml | 101 ++++++++++++++++++ src/client/app/ssr.ts | 2 +- .../theme-default/components/VPSocialLink.vue | 29 ++++- src/client/theme-default/styles/icons.css | 33 ------ src/node/build/build.ts | 26 ++++- src/node/build/render.ts | 10 +- types/default-theme.d.ts | 14 +-- types/shared.d.ts | 2 + 15 files changed, 170 insertions(+), 146 deletions(-) diff --git a/docs/en/reference/default-theme-config.md b/docs/en/reference/default-theme-config.md index 4a431538..90232aea 100644 --- a/docs/en/reference/default-theme-config.md +++ b/docs/en/reference/default-theme-config.md @@ -228,6 +228,7 @@ You may define this option to show your social account links with icons in nav. export default { themeConfig: { socialLinks: [ + // You can add any icon from simple-icons (https://simpleicons.org/): { icon: 'github', link: 'https://github.com/vuejs/vitepress' }, { icon: 'twitter', link: '...' }, // You can also add custom icons by passing SVG as string: @@ -246,24 +247,10 @@ export default { ```ts interface SocialLink { - icon: SocialLinkIcon + icon: string | { svg: string } link: string ariaLabel?: string } - -type SocialLinkIcon = - | 'discord' - | 'facebook' - | 'github' - | 'instagram' - | 'linkedin' - | 'mastodon' - | 'npm' - | 'slack' - | 'twitter' - | 'x' - | 'youtube' - | { svg: string } ``` ## footer diff --git a/docs/es/reference/default-theme-config.md b/docs/es/reference/default-theme-config.md index 72cebed7..129f16f6 100644 --- a/docs/es/reference/default-theme-config.md +++ b/docs/es/reference/default-theme-config.md @@ -233,24 +233,10 @@ export default { ```ts interface SocialLink { - icon: SocialLinkIcon + icon: string | { svg: string } link: string ariaLabel?: string } - -type SocialLinkIcon = - | 'discord' - | 'facebook' - | 'github' - | 'instagram' - | 'linkedin' - | 'mastodon' - | 'npm' - | 'slack' - | 'twitter' - | 'x' - | 'youtube' - | { svg: string } ``` ## footer diff --git a/docs/ko/reference/default-theme-config.md b/docs/ko/reference/default-theme-config.md index b9ae6987..b0df3361 100644 --- a/docs/ko/reference/default-theme-config.md +++ b/docs/ko/reference/default-theme-config.md @@ -246,24 +246,10 @@ export default { ```ts interface SocialLink { - icon: SocialLinkIcon + icon: string | { svg: string } link: string ariaLabel?: string } - -type SocialLinkIcon = - | 'discord' - | 'facebook' - | 'github' - | 'instagram' - | 'linkedin' - | 'mastodon' - | 'npm' - | 'slack' - | 'twitter' - | 'x' - | 'youtube' - | { svg: string } ``` ## footer diff --git a/docs/pt/reference/default-theme-config.md b/docs/pt/reference/default-theme-config.md index 417cbc30..54e53e4a 100644 --- a/docs/pt/reference/default-theme-config.md +++ b/docs/pt/reference/default-theme-config.md @@ -233,24 +233,10 @@ export default { ```ts interface SocialLink { - icon: SocialLinkIcon + icon: string | { svg: string } link: string ariaLabel?: string } - -type SocialLinkIcon = - | 'discord' - | 'facebook' - | 'github' - | 'instagram' - | 'linkedin' - | 'mastodon' - | 'npm' - | 'slack' - | 'twitter' - | 'x' - | 'youtube' - | { svg: string } ``` ## footer diff --git a/docs/ru/reference/default-theme-config.md b/docs/ru/reference/default-theme-config.md index 265d17f1..56c802e6 100644 --- a/docs/ru/reference/default-theme-config.md +++ b/docs/ru/reference/default-theme-config.md @@ -233,24 +233,10 @@ export default { ```ts interface SocialLink { - icon: SocialLinkIcon + icon: string | { svg: string } link: string ariaLabel?: string } - -type SocialLinkIcon = - | 'discord' - | 'facebook' - | 'github' - | 'instagram' - | 'linkedin' - | 'mastodon' - | 'npm' - | 'slack' - | 'twitter' - | 'x' - | 'youtube' - | { svg: string } ``` ## footer {#footer} diff --git a/docs/zh/reference/default-theme-config.md b/docs/zh/reference/default-theme-config.md index a7028f16..dd7e86b3 100644 --- a/docs/zh/reference/default-theme-config.md +++ b/docs/zh/reference/default-theme-config.md @@ -233,24 +233,10 @@ export default { ```ts interface SocialLink { - icon: SocialLinkIcon + icon: string | { svg: string } link: string ariaLabel?: string } - -type SocialLinkIcon = - | 'discord' - | 'facebook' - | 'github' - | 'instagram' - | 'linkedin' - | 'mastodon' - | 'npm' - | 'slack' - | 'twitter' - | 'x' - | 'youtube' - | { svg: string } ``` ## footer diff --git a/package.json b/package.json index b486493c..350380e3 100644 --- a/package.json +++ b/package.json @@ -100,6 +100,7 @@ "dependencies": { "@docsearch/css": "^3.6.2", "@docsearch/js": "^3.6.2", + "@iconify-json/simple-icons": "^1.2.10", "@shikijs/core": "^1.22.2", "@shikijs/transformers": "^1.22.2", "@shikijs/types": "^1.22.2", @@ -118,6 +119,7 @@ }, "devDependencies": { "@clack/prompts": "^0.7.0", + "@iconify/utils": "^2.1.33", "@mdit-vue/plugin-component": "^2.1.3", "@mdit-vue/plugin-frontmatter": "^2.1.3", "@mdit-vue/plugin-headers": "^2.1.3", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 3c7b1692..3fbd6a8f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -22,6 +22,9 @@ importers: '@docsearch/js': specifier: ^3.6.2 version: 3.6.2(@algolia/client-search@4.24.0) + '@iconify-json/simple-icons': + specifier: ^1.2.10 + version: 1.2.10 '@shikijs/core': specifier: ^1.22.2 version: 1.22.2 @@ -71,6 +74,9 @@ importers: '@clack/prompts': specifier: ^0.7.0 version: 0.7.0 + '@iconify/utils': + specifier: ^2.1.33 + version: 2.1.33(supports-color@9.4.0) '@mdit-vue/plugin-component': specifier: ^2.1.3 version: 2.1.3 @@ -385,6 +391,12 @@ packages: '@algolia/transporter@4.24.0': resolution: {integrity: sha512-86nI7w6NzWxd1Zp9q3413dRshDqAzSbsQjhcDhPIatEFiZrL1/TjnHL8S7jVKFePlIMzDsZWXAXwXzcok9c5oA==} + '@antfu/install-pkg@0.4.1': + resolution: {integrity: sha512-T7yB5QNG29afhWVkVq7XeIMBa5U/vs9mX69YqayXypPRmYzUmzwnYltplHmPtZ4HPCn+sQKeXW8I47wCbuBOjw==} + + '@antfu/utils@0.7.10': + resolution: {integrity: sha512-+562v9k4aI80m1+VuMHehNJWLOFjBnXn3tdOitzD0il5b7smkSBal4+a3oKiQTbrwMmN/TBUMDvbdoWDehgOww==} + '@babel/code-frame@7.25.7': resolution: {integrity: sha512-0xZJFNE5XMpENsgfHYTw8FbX4kv53mFLn2i3XPoq69LyhYSCBJtitaHx9QnsVTrsogI4Z3+HtEfZ2/GFPOtf5g==} engines: {node: '>=6.9.0'} @@ -745,6 +757,15 @@ packages: resolution: {integrity: sha512-e5+YUKENATs1JgYHMzTr2MW/NDcXGfYFAuOQU8gJgF/kEh4EqKgfGrfLI67bMD4tbhZVlkigz/9YYwWcbOFthg==} engines: {node: '>=10.13.0'} + '@iconify-json/simple-icons@1.2.10': + resolution: {integrity: sha512-9OK1dsSjXlH36lhu5n+BlSoXuqFjHUErGLtNdzHpq0vHq4YFBuGYWtZ+vZTHLreRQ8ijPRv/6EsgkV+nf6AReQ==} + + '@iconify/types@2.0.0': + resolution: {integrity: sha512-+wluvCrRhXrhyOmRDJ3q8mux9JkKy5SJ/v8ol2tu4FVjyYvtEzkc/3pK15ET6RKg4b4w4BmTk1+gsCUhf21Ykg==} + + '@iconify/utils@2.1.33': + resolution: {integrity: sha512-jP9h6v/g0BIZx0p7XGJJVtkVnydtbgTgt9mVNcGDYwaa7UhdHdI9dvoq+gKj9sijMSJKxUPEG2JyjsgXjxL7Kw==} + '@isaacs/cliui@8.0.2': resolution: {integrity: sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==} engines: {node: '>=12'} @@ -1234,6 +1255,11 @@ packages: '@vueuse/shared@11.1.0': resolution: {integrity: sha512-YUtIpY122q7osj+zsNMFAfMTubGz0sn5QzE5gPzAIiCmtt2ha3uQUY1+JPyL4gRCTsLPX82Y9brNbo/aqlA91w==} + acorn@8.14.0: + resolution: {integrity: sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==} + engines: {node: '>=0.4.0'} + hasBin: true + add-stream@1.0.0: resolution: {integrity: sha512-qQLMr+8o0WC4FZGQTcJiKBVC59JylcPSrTtk6usvmIDFUOCKegapy1VHQwRbFMOFyb/inzUVqHs+eMYKDM1YeQ==} @@ -1414,6 +1440,9 @@ packages: compare-func@2.0.0: resolution: {integrity: sha512-zHig5N+tPWARooBnb0Zx1MFcdfpyJrfTJ3Y5L+IFvUm8rM74hHz66z0gw0x4tijh5CorKkKUCnW82R2vmpeCRA==} + confbox@0.1.8: + resolution: {integrity: sha512-RMtmw0iFkeR4YV+fUOSucriAQNb9g8zFR52MWCtl+cCZOFRNL6zeB395vPzFhEjjn4fMxXudmELnl/KF/WrK6w==} + conventional-changelog-angular@8.0.0: resolution: {integrity: sha512-CLf+zr6St0wIxos4bmaKHRXWAcsCXrJU6F4VdNDrGRK3B8LDLKoX3zuMV5GhtbGkVR/LohZ6MT6im43vZLSjmA==} engines: {node: '>=18'} @@ -1947,6 +1976,9 @@ packages: resolution: {integrity: sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==} engines: {node: '>=6'} + kolorist@1.8.0: + resolution: {integrity: sha512-Y+60/zizpJ3HRH8DCss+q95yr6145JXZo46OTpFvDZWLfRCE4qChOyk1b26nMaNpfHHgxagk9dXT5OP0Tfe+dQ==} + lilconfig@3.1.2: resolution: {integrity: sha512-eop+wDAvpItUys0FWkHIKeC9ybYrTGbU41U5K7+bttZZeohvnY7M9dZ5kB21GNWiFT2q1OoPTvncPCgSOVO5ow==} engines: {node: '>=14'} @@ -1963,6 +1995,10 @@ packages: resolution: {integrity: sha512-iyAZCeyD+c1gPyE9qpFu8af0Y+MRtmKOncdGoA2S5EY8iFq99dmmvkNnHiWo+pj0s7yH7l3KPIgee77tKpXPWQ==} engines: {node: '>=18.0.0'} + local-pkg@0.5.0: + resolution: {integrity: sha512-ok6z3qlYyCDS4ZEU27HaU6x/xZa9Whf8jD4ptH5UZTQYZVYeb9bnZ3ojVhiJNLiXK1Hfc0GNbLXcmZ5plLDDBg==} + engines: {node: '>=14'} + lodash._reinterpolate@3.0.0: resolution: {integrity: sha512-xYHt68QRoYGjeeM/XOE1uJtvXQAgvszfBhjV4yvsQH0u2i9I6cI6c6/eG4Hh3UAOVn0y/xAXwmTzEay49Q//HA==} @@ -2118,6 +2154,9 @@ packages: mj-context-menu@0.6.1: resolution: {integrity: sha512-7NO5s6n10TIV96d4g2uDpG7ZDpIhMh0QNfGdJw/W47JswFcosz457wqz/b5sAKvl12sxINGFCn80NZHKwxQEXA==} + mlly@1.7.2: + resolution: {integrity: sha512-tN3dvVHYVz4DhSXinXIk7u9syPYaJvio118uomkovAtWBT+RdbP6Lfh/5Lvo519YMmwBafwlh20IPTXIStscpA==} + mrmime@2.0.0: resolution: {integrity: sha512-eu38+hdgojoyq63s+yTpN4XMBdt5l8HhMhc4VKLO9KM5caLIBvUm4thi7fFaxyTmCKeNnXZ5pAlBwCUnhA09uw==} engines: {node: '>=10'} @@ -2200,6 +2239,9 @@ packages: package-json-from-dist@1.0.1: resolution: {integrity: sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==} + package-manager-detector@0.2.2: + resolution: {integrity: sha512-VgXbyrSNsml4eHWIvxxG/nTL4wgybMTXCV2Un/+yEc3aDKKU6nQBZjbeP3Pl3qm9Qg92X/1ng4ffvCeD/zwHgg==} + parse-json@8.1.0: resolution: {integrity: sha512-rum1bPifK5SSar35Z6EKZuYPJx85pkNaFrxBK3mwdfSJ1/WKbYrjoW/zTPSjRRamfmVX1ACBIdFAO0VRErW/EA==} engines: {node: '>=18'} @@ -2272,6 +2314,9 @@ packages: resolution: {integrity: sha512-4peoBq4Wks0riS0z8741NVv+/8IiTvqnZAr8QGgtdifrtpdXbNw/FxRS1l6NFqm4EMzuS0EDqNNx4XGaz8cuyQ==} engines: {node: '>=18'} + pkg-types@1.2.1: + resolution: {integrity: sha512-sQoqa8alT3nHjGuTjuKgOnvjo4cljkufdtLMnO2LBP/wRwuDlo1tkaEdMxCRhyGRPacv/ztlZgDPm2b7FAmEvw==} + playwright-chromium@1.48.2: resolution: {integrity: sha512-bMBvYPlj5X6yyifahATDy5ZQySyNRDD75Q8ZCMcvn234CCA7m8vxgJIlrbJq+jcmuZVsCzNybRtEJHVGqg+v4w==} engines: {node: '>=18'} @@ -2666,6 +2711,9 @@ packages: uc.micro@2.1.0: resolution: {integrity: sha512-ARDJmphmdvUk6Glw7y9DQ2bFkKBHwQHLi2lsaH6PPmz/Ka9sFOBsBluozhDltWmnv9u/cF6Rt87znRTPV+yp/A==} + ufo@1.5.4: + resolution: {integrity: sha512-UsUk3byDzKd04EyoZ7U4DOlxQaD14JUKQl6/P7wiX4FNvUfm3XL246n9W5AmqwW5RSFJ27NAuM0iLscAOYUiGQ==} + uglify-js@3.19.3: resolution: {integrity: sha512-v3Xu+yuwBXisp6QYTcH4UbH+xYJXqnq2m/LtQVWKWzYc1iehYnLixoQDN9FH6/j9/oybfd6W9Ghwkl8+UMKTKQ==} engines: {node: '>=0.8.0'} @@ -2980,6 +3028,13 @@ snapshots: '@algolia/logger-common': 4.24.0 '@algolia/requester-common': 4.24.0 + '@antfu/install-pkg@0.4.1': + dependencies: + package-manager-detector: 0.2.2 + tinyexec: 0.3.1 + + '@antfu/utils@0.7.10': {} + '@babel/code-frame@7.25.7': dependencies: '@babel/highlight': 7.25.7 @@ -3196,6 +3251,24 @@ snapshots: '@hutson/parse-repository-url@5.0.0': {} + '@iconify-json/simple-icons@1.2.10': + dependencies: + '@iconify/types': 2.0.0 + + '@iconify/types@2.0.0': {} + + '@iconify/utils@2.1.33(supports-color@9.4.0)': + dependencies: + '@antfu/install-pkg': 0.4.1 + '@antfu/utils': 0.7.10 + '@iconify/types': 2.0.0 + debug: 4.3.7(supports-color@9.4.0) + kolorist: 1.8.0 + local-pkg: 0.5.0 + mlly: 1.7.2 + transitivePeerDependencies: + - supports-color + '@isaacs/cliui@8.0.2': dependencies: string-width: 5.1.2 @@ -3724,6 +3797,8 @@ snapshots: - '@vue/composition-api' - vue + acorn@8.14.0: {} + add-stream@1.0.0: {} algoliasearch@4.24.0: @@ -3913,6 +3988,8 @@ snapshots: array-ify: 1.0.0 dot-prop: 5.3.0 + confbox@0.1.8: {} + conventional-changelog-angular@8.0.0: dependencies: compare-func: 2.0.0 @@ -4481,6 +4558,8 @@ snapshots: kleur@3.0.3: {} + kolorist@1.8.0: {} + lilconfig@3.1.2: {} linkify-it@5.0.0: @@ -4511,6 +4590,11 @@ snapshots: rfdc: 1.4.1 wrap-ansi: 9.0.0 + local-pkg@0.5.0: + dependencies: + mlly: 1.7.2 + pkg-types: 1.2.1 + lodash._reinterpolate@3.0.0: {} lodash.template@4.5.0: @@ -4663,6 +4747,13 @@ snapshots: mj-context-menu@0.6.1: {} + mlly@1.7.2: + dependencies: + acorn: 8.14.0 + pathe: 1.1.2 + pkg-types: 1.2.1 + ufo: 1.5.4 + mrmime@2.0.0: {} ms@2.1.3: {} @@ -4743,6 +4834,8 @@ snapshots: package-json-from-dist@1.0.1: {} + package-manager-detector@0.2.2: {} + parse-json@8.1.0: dependencies: '@babel/code-frame': 7.25.7 @@ -4794,6 +4887,12 @@ snapshots: dependencies: find-up-simple: 1.0.0 + pkg-types@1.2.1: + dependencies: + confbox: 0.1.8 + mlly: 1.7.2 + pathe: 1.1.2 + playwright-chromium@1.48.2: dependencies: playwright-core: 1.48.2 @@ -5176,6 +5275,8 @@ snapshots: uc.micro@2.1.0: {} + ufo@1.5.4: {} + uglify-js@3.19.3: optional: true diff --git a/src/client/app/ssr.ts b/src/client/app/ssr.ts index eb408cc7..984335f0 100644 --- a/src/client/app/ssr.ts +++ b/src/client/app/ssr.ts @@ -6,7 +6,7 @@ import type { SSGContext } from '../shared' export async function render(path: string) { const { app, router } = await createApp() await router.go(path) - const ctx: SSGContext = { content: '' } + const ctx: SSGContext = { content: '', vpSocialIcons: new Set() } ctx.content = await renderToString(app, ctx) return ctx } diff --git a/src/client/theme-default/components/VPSocialLink.vue b/src/client/theme-default/components/VPSocialLink.vue index 1c0a8ab3..905ec897 100644 --- a/src/client/theme-default/components/VPSocialLink.vue +++ b/src/client/theme-default/components/VPSocialLink.vue @@ -1,6 +1,7 @@