\r\n\r\n::: zh-CN\r\n中文\r\n:::\r\n\r\n::: en\r\nEnglish\r\n:::\r\n```\r\n\r\nThis reduces maintenance costs.\r\n\r\nI came up with a very low cost implementation - [CSS-I18N](https://github.com/valaxyjs/css-i18n)\r\nAnd I implemented it in my own project [valaxy](https://github.com/YunYouJun/valaxy).\r\n\r\nIt works well. You can preview it [here](https://valaxy.site/guide/i18n).\r\nAnd this is my implementation: [How to realize CSS i18n?](https://valaxy.site/posts/i18n#css-i18n-another-solution)\r\n\r\n---\r\n\r\nIt is very cost-effective and I hope to integrate it with vitepress.\r\nIf you agree with my proposal, please let me know and I can create a PR for vitepress.\r\n\r\n### Describe alternatives you've considered\r\n\r\n_No response_\r\n\r\n### Additional context\r\n\r\n_No response_\r\n\r\n### Validations\r\n\r\n- [X] Follow our [Code of Conduct](https://vuejs.org/about/coc.html)\r\n- [X] Read the [docs](https://vitepress.dev).\r\n- [X] Read the [Contributing Guidelines](https://github.com/vuejs/vitepress/blob/main/.github/contributing.md).\r\n- [X] Check that there isn't already an issue that asks for the same feature to avoid creating a duplicate.",[3020],{"name":3021,"color":3022},"stale","ededed",3047,"vuejs","vitepress","open","CSS i18n in one page","2025-03-02T18:10:37Z","https://github.com/vuejs/vitepress/issues/3047",0.741653,{"description":3032,"labels":3033,"number":3035,"owner":3024,"repository":3025,"state":3026,"title":3036,"updated_at":3037,"url":3038,"score":3039},"### Is your feature request related to a problem? Please describe.\n\nCurrently logo is added using `img` element. This prevents certain kinds of CSS within the SVG from applying correctly, and it prevents CSS within the app (html file) from applying to it.\r\n\r\nThis is related to https://github.com/vuejs/vitepress/issues/3828 however my motivation is not exactly the same.\n\n### Describe the solution you'd like\n\nI would like a way to specify that an SVG logo should be inlined directly into the HTML.\n\n### Describe alternatives you've considered\n\n_No response_\n\n### Additional context\n\nMy goal is to have a single SVG logo file that will adapt to the dark/light mode theme automatically via this in its markup:\r\n\r\n```html\r\n \u003Cstyle>\r\n @media (prefers-color-scheme: light) { :root { filter: none; } }\r\n @media (prefers-color-scheme: dark) { :root { filter: invert(100%); } }\r\n \u003C/style>\r\n```\n\n### Validations\n\n- [X] Follow our [Code of Conduct](https://vuejs.org/about/coc.html)\n- [X] Read the [docs](https://vitepress.dev).\n- [X] Read the [Contributing Guidelines](https://github.com/vuejs/vitepress/blob/main/.github/contributing.md).\n- [X] Check that there isn't already an issue that asks for the same feature to avoid creating a duplicate.",[3034],{"name":3021,"color":3022},4141,"Allow SVG logo to be inlined","2024-09-29T09:05:48Z","https://github.com/vuejs/vitepress/issues/4141",0.7649377,{"description":3041,"labels":3042,"number":3043,"owner":3024,"repository":3025,"state":3044,"title":3045,"updated_at":3046,"url":3047,"score":3048},"when use some new language blocks in `md`, such as `wgsl`, it shows `No language registration for wgsl`\r\n\r\nThe shiki support add custom languages: https://github.com/shikijs/shiki/blob/main/docs/languages.md#supporting-your-own-languages-with-shiki\r\n\r\nThen, how to use it in VitePress to add custom languages?",[],1331,"closed","How to add register language/grammar for shiki?","2023-01-21T14:25:07Z","https://github.com/vuejs/vitepress/issues/1331",0.73899555,{"description":3050,"labels":3051,"number":3052,"owner":3024,"repository":3025,"state":3044,"title":3053,"updated_at":3054,"url":3055,"score":3056},"### Describe the bug\n\nvitepress 打包和 vite 存在一些差异,我在项目中使用 @antv/g2plot,如果使用 vite 可以正常编译,使用 vitepress 编译则会失败。\r\n尽管我可以将 @antv/g2plot 的依赖指定低版本避免这个错误,但是我想知道为什么会出现这种情况;\r\n\r\nen:There are some differences between vitepress compilation and vite, I use @antv/g2plot in my project, if I use vite it compiles fine, if I use vitepress it compiles fine, I use vitepress to compile it fails. Although I could avoid this error by specifying the dependency of @antv/g2plot at a lower version, I wonder why this is the case\n\n### Reproduction\n\n1. Create a new Vite+Vue project\r\n2. Add @ antv/g2plot dependency and use word cloud diagram in the component, for example: https://g2plot.antv.antgroup.com/examples/more-plots/word-cloud#same -place\r\n3. Preview effect, compile project, compile normally\r\n\r\n4. Install vitepress v1.2.3, initialize\r\n5. Create a component usage word cloud and import it in the document\r\n6. Compile document, compilation failed\r\n\r\nhttps://github.com/peiyanlu/vite-test-antv\n\n### Expected behavior\n\nbuild success\n\n### System Info\n\n```Text\nSystem:\r\n OS: Windows 11 10.0.26100\r\n CPU: (32) x64 13th Gen Intel(R) Core(TM) i9-13980HX\r\n Memory: 10.03 GB / 31.63 GB\r\n Binaries:\r\n Node: 18.16.0 - C:\\Program Files\\nodejs\\node.EXE\r\n npm: 9.5.1 - C:\\Program Files\\nodejs\\npm.CMD\r\n pnpm: 9.4.0 - ~\\AppData\\Local\\pnpm\\pnpm.EXE\r\n Browsers:\r\n Edge: Chromium (126.0.2592.87)\r\n Internet Explorer: 11.0.26100.1\r\n npmPackages:\r\n vitepress: ^1.2.3 => 1.2.3\n```\n\n\n### Additional context\n\n_No response_\n\n### Validations\n\n- [X] Check if you're on the [latest VitePress version](https://github.com/vuejs/vitepress/releases/latest).\n- [X] Follow our [Code of Conduct](https://vuejs.org/about/coc.html)\n- [X] Read the [docs](https://vitepress.dev).\n- [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.",[],4021,"build error with @antv/g2plot","2024-07-18T04:42:22Z","https://github.com/vuejs/vitepress/issues/4021",0.7409946,{"description":3058,"labels":3059,"number":3063,"owner":3024,"repository":3025,"state":3044,"title":3064,"updated_at":3065,"url":3066,"score":3067},"### Describe the bug\r\n\r\nSuch code:\r\n\r\n````md\r\n```vue twoslash :line-numbers\r\n\u003Cscript setup lang=\"ts\">\r\nimport {ref} from 'vue';\r\n\r\nconst message = ref('Hello world!');\r\n\u003C/script>\r\n```\r\n````\r\n\r\ncode block line numbers would be from 1 to 2, rather than from 1 to 5, [see here](http://localhost:5173/knowledge-base/TODO#bug)\r\n\r\n### Reproduction\r\n\r\nusing such code in `vitepress`:\r\n\r\n````md\r\n```vue twoslash :line-numbers\r\n\u003Cscript setup lang=\"ts\">\r\nimport {ref} from 'vue';\r\n\r\nconst message = ref('Hello world!');\r\n\u003C/script>\r\n```\r\n````\r\n\r\n### Expected behavior\r\n\r\nline number works correctly\r\n\r\n### System Info\r\n\r\n```Text\r\nnone\r\n```\r\n\r\n\r\n### Additional context\r\n\r\n_No response_\r\n\r\n### Validations\r\n\r\n- [X] Check if you're on the [latest VitePress version](https://github.com/vuejs/vitepress/releases/latest).\r\n- [X] Follow our [Code of Conduct](https://vuejs.org/about/coc.html)\r\n- [X] Read the [docs](https://vitepress.dev).\r\n- [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.",[3060],{"name":3061,"color":3062},"bug: pending triage","e99695",3972,"[BUG]","2024-06-28T04:43:03Z","https://github.com/vuejs/vitepress/issues/3972",0.74303234,{"description":3069,"labels":3070,"number":3072,"owner":3024,"repository":3025,"state":3044,"title":3073,"updated_at":3074,"url":3075,"score":3076},"### Describe the bug\n\n使用本地搜索,搜索段落中间的中文无法显示结果,如果是英文没有这个问题。如果搜索的中文是段落前面几个字或者挨着标点符号的中文才显示结果\r\n\u003Cimg width=\"851\" alt=\"image\" src=\"https://github.com/vuejs/vitepress/assets/5304020/d0173cac-b32f-40e8-99f8-546d7d24a21a\">\r\n\u003Cimg width=\"1041\" alt=\"image\" src=\"https://github.com/vuejs/vitepress/assets/5304020/cd28bd06-5531-4eed-97f0-a851093c9391\">\r\n\n\n### Reproduction\n\n可以在我的博客https://www.appbeebee.com/尝试搜索段落中间的中文和段落前的中文进行比较\n\n### Expected behavior\n\n希望本地搜索能进行全文中文搜索,而不是仅仅搜索段落前的中文\n\n### System Info\n\n```Text\nmac google chrome\n```\n\n\n### Additional context\n\n_No response_\n\n### Validations\n\n- [X] Check if you're on the [latest VitePress version](https://github.com/vuejs/vitepress/releases/latest).\n- [X] Follow our [Code of Conduct](https://vuejs.org/about/coc.html)\n- [X] Read the [docs](https://vitepress.dev).\n- [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.",[3071],{"name":3061,"color":3062},3507,"本地搜索对中文不是很友好","2024-02-04T00:04:52Z","https://github.com/vuejs/vitepress/issues/3507",0.74345535,{"description":3078,"labels":3079,"number":3084,"owner":3024,"repository":3025,"state":3044,"title":3085,"updated_at":3086,"url":3087,"score":3088},"### Is your feature request related to a problem? Please describe.\n\n* Here is a closed \u003Chttps://github.com/vuejs/vitepress/pull/978>\r\n* But it has some problems, for example\r\n>Open this for example: https://deploy-preview-978--vitepress-docs.netlify.app/guide/getting-started.html. Click on \"What's next\" on the right hand side. It won't reach to the top at all, you'll have to click that again.\r\n>\r\n>URL hash will also be messed up in certain scenario because we are probably throttling for 100ms, but the scroll animation may take much longer. \n\n### Describe the solution you'd like\n\n* I don't understand why.\r\n* And its scrolling is inaccurate like you said.\r\n * Not just \"What's next\" , all opportunities come up with this question\n\n### Describe alternatives you've considered\n\n_No response_\n\n### Additional context\n\n_No response_\n\n### Validations\n\n- [X] Follow our [Code of Conduct](https://vuejs.org/about/coc.html)\n- [X] Read the [docs](https://vitepress.vuejs.org).\n- [X] Read the [Contributing Guidelines](https://github.com/vuejs/vitepress/blob/main/.github/contributing.md).\n- [X] Check that there isn't already an issue that asks for the same feature to avoid creating a duplicate.",[3080,3083],{"name":3081,"color":3082},"theme","0754FB",{"name":3021,"color":3022},979,"add smooth scrolling behavior","2023-08-11T00:04:23Z","https://github.com/vuejs/vitepress/issues/979",0.74581575,{"description":3090,"labels":3091,"number":3095,"owner":3024,"repository":3025,"state":3044,"title":3096,"updated_at":3097,"url":3098,"score":3099},"### Describe the bug\n\nI want to change the default added head meta viewport from \r\n\r\n```\r\n\u003Cmeta name=\"viewport\" content=\"width=device-width,initial-scale=1\">\r\n```\r\nto\r\n```\r\n\u003Cmeta name=\"viewport\" content=\"width=device-width,initial-scale=1,maximum-scale=1\">\r\n```\r\nto avoid iOS phone issue where small input fields are zoomed for input (generated by used Web Components).\r\n\r\nThe tag is generated twice, but i would like to control it for custom needs.\n\n### Reproduction\n\nInside ``config.ts`` add \r\n```\r\n..\r\n head: [\r\n [\"meta\", { name: \"viewport\", content: \"width=device-width,initial-scale=1,maximum-scale=1\" }],\r\n ...\r\n```\r\n\n\n### Expected behavior\n\nThere is only on html head entry for the meta viewport.\r\n\r\nCurrently, the meta viewport is generated twice (from theme and also from config).\n\n### System Info\n\n```sh\nSystem:\r\n OS: Windows 10 10.0.22621\r\n CPU: (12) x64 AMD Ryzen 5 3600 6-Core Processor\r\n Memory: 5.81 GB / 15.95 GB\r\n Binaries:\r\n Node: 18.16.1 - C:\\Program Files\\nodejs\\node.EXE\r\n npm: 9.5.1 - C:\\Program Files\\nodejs\\npm.CMD\r\n Browsers:\r\n Chrome: 114.0.5735.199\r\n Edge: Spartan (44.22621.1992.0), Chromium (114.0.1823.67)\r\n Internet Explorer: 11.0.22621.1\r\n npmPackages:\r\n vitepress: ^1.0.0-beta.5 => 1.0.0-beta.5\n```\n\n\n### Additional context\n\n_No response_\n\n### Validations\n\n- [X] Check if you're on the [latest VitePress version](https://github.com/vuejs/vitepress/releases/latest).\n- [X] Follow our [Code of Conduct](https://vuejs.org/about/coc.html)\n- [X] Read the [docs](https://vitepress.dev).\n- [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.",[3092],{"name":3093,"color":3094},"build","377ba8",2631,"Support overriding viewport meta tag","2023-07-29T00:04:12Z","https://github.com/vuejs/vitepress/issues/2631",0.7617335,{"description":3101,"labels":3102,"number":3104,"owner":3024,"repository":3025,"state":3044,"title":3105,"updated_at":3106,"url":3107,"score":3108},"### Describe the bug\n\nWhen I run `vitepress build docs`, an error comes out\r\n``` shell\r\nPS D:\\Ysh\\Repos\\ysh-ui-proj\\proj\\ysh-ui> npm run docs:build\r\n\r\n> ysh-ui@0.0.1 docs:build\r\n> vitepress build docs\r\n\r\nvitepress v1.0.0-alpha.4\r\n⠼ building client + server bundles...\r\n(!) Some chunks are larger than 500 KiB after minification. Consider:\r\n- Using dynamic import() to code-split the application\r\n- Use build.rollupOptions.output.manualChunks to improve chunking: https://rollupjs.org/guide/en/#outputmanualchunks\r\n- Adjust chunk size limit for this warning via build.chunkSizeWarningLimit.\r\n✓ building client + server bundles...\r\n✖ rendering pages...\r\nbuild error:\r\n ReferenceError: location is not defined\r\n at Module.\u003Canonymous> (D:\\Ysh\\Repos\\ysh-ui-proj\\proj\\ysh-ui\\docs\\.vitepress\\.temp\\app.js:4087:12)\r\n at Module._compile (node:internal/modules/cjs/loader:1095:14)\r\n at Object.Module._extensions..js (node:internal/modules/cjs/loader:1124:10)\r\n at Module.load (node:internal/modules/cjs/loader:975:32)\r\n at Function.Module._load (node:internal/modules/cjs/loader:816:12)\r\n at ModuleWrap.\u003Canonymous> (node:internal/modules/esm/translators:201:29)\r\n at ModuleJob.run (node:internal/modules/esm/module_job:183:25)\r\n at async Loader.import (node:internal/modules/esm/loader:178:24)\r\n at async renderPage (file:///D:/Ysh/Repos/ysh-ui-proj/proj/ysh-ui/node_modules/vitepress/dist/node/serve-05342c3d.js:39534:25)\r\n at async build (file:///D:/Ysh/Repos/ysh-ui-proj/proj/ysh-ui/node_modules/vitepress/dist/node/serve-05342c3d.js:39853:9)\r\n```\n\n### Reproduction\n\nI have import a component form `ysh-ui\\docs\\.vitepress\\theme\\components`, my component need load `location.hash` when create.\r\n``` ts\r\nlet hash: string = location.hash.slice(1);\r\n```\n\n### Expected behavior\n\nIs it the cause of SSR? \n\n### System Info\n\n```shell\nSystem:\r\n OS: Windows 10 10.0.19043\r\n CPU: (4) x64 Intel(R) Core(TM) i5-7500 CPU @ 3.40GHz\r\n Memory: 3.28 GB / 15.89 GB\r\n Binaries:\r\n Node: 16.5.0 - C:\\Program Files\\nodejs\\node.EXE \r\n Yarn: 1.22.19 - C:\\Program Files\\nodejs\\yarn.CMD \r\n npm: 7.19.1 - C:\\Program Files\\nodejs\\npm.CMD\r\n Browsers:\r\n Edge: Spartan (44.19041.1266.0), Chromium (103.0.1264.62)\r\n Internet Explorer: 11.0.19041.1566\r\n npmPackages:\r\n vitepress: ^1.0.0-alpha.4 => 1.0.0-alpha.4\n```\n\n\n### Additional context\n\n_No response_\n\n### Validations\n\n- [X] Follow our [Code of Conduct](https://vuejs.org/about/coc.html)\n- [X] Read the [docs](https://vitepress.vuejs.org).\n- [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.",[3103],{"name":3061,"color":3062},1017,"location is not defined","2023-01-21T14:30:21Z","https://github.com/vuejs/vitepress/issues/1017",0.76432616,{"description":3110,"labels":3111,"number":3116,"owner":3024,"repository":3025,"state":3044,"title":3117,"updated_at":3118,"url":3119,"score":3120},"### Is your feature request related to a problem? Please describe.\r\n\r\nHello,\r\n\r\nActually, I have to create a loader for each language, and then import all of them in my vue component.\r\n\r\n```ts\r\n// @ts-expect-error - vitepress types are not available\r\nimport { data as rootData } from '../../data/posts.data'\r\n// @ts-expect-error - vitepress types are not available\r\nimport { data as frData } from '../../data/fr-posts.data'\r\nimport { computed } from 'vue';\r\n\r\nconst data: Record\u003Cstring, any> = {\r\n root: rootData,\r\n fr: frData\r\n}\r\n\r\nconst { localeIndex } = useData()\r\n\r\nconst posts = computed(() => data[localeIndex.value])\r\n```\r\n\r\n### Describe the solution you'd like\r\n\r\nI would like to have to only create a single content loader and based on my locales configuration (and maybe an option) retrive all content.\r\n\r\nFor example: `posts/*.md` should get `posts/*.md` (the root) and `fr/posts/*.md` (the fr locale).\r\n\r\n### Describe alternatives you've considered\r\n\r\n_No response_\r\n\r\n### Additional context\r\n\r\n_No response_\r\n\r\n### Validations\r\n\r\n- [X] Follow our [Code of Conduct](https://vuejs.org/about/coc.html)\r\n- [X] Read the [docs](https://vitepress.dev).\r\n- [X] Read the [Contributing Guidelines](https://github.com/vuejs/vitepress/blob/main/.github/contributing.md).\r\n- [X] Check that there isn't already an issue that asks for the same feature to avoid creating a duplicate.",[3112,3115],{"name":3113,"color":3114},"has-workaround","1B4515",{"name":3021,"color":3022},4072,"Support i18n in `contentLoader`","2024-10-08T04:44:35Z","https://github.com/vuejs/vitepress/issues/4072",0.76510274,["Reactive",3122],{},["Set"],["ShallowReactive",3125],{"$fTRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"$fjXbfmCH-VIdprtDcUnhONrcXsBLWJhN1qy0cufbYMTk":-1},"/vuejs/vitepress/3601"]