\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.",[2867],{"name":2868,"color":2869},"stale","ededed",3047,"vuejs","vitepress","open","CSS i18n in one page","2025-03-02T18:10:37Z","https://github.com/vuejs/vitepress/issues/3047",0.7748243,{"description":2879,"labels":2880,"number":2882,"owner":2871,"repository":2872,"state":2873,"title":2883,"updated_at":2884,"url":2885,"score":2886},"### Describe the bug\n\n[Subpath imports](https://nodejs.org/api/packages.html#subpath-imports) configured in `package.json` are not resolved in `.vitepress/config.ts` and `*.data.ts`.\n\n### Reproduction\n\n[StackBlitz](https://stackblitz.com/edit/vitepress-subpath-imports?file=docs%2F.vitepress%2Fconfig.ts)\r\n\r\n1. Configure subpath imports in `package.json`\r\n```json\r\n \"imports\": {\r\n \"#*\": \"./*\"\r\n }\r\n```\r\n\r\n2. Create a module exporting data in the project root\r\n```ts\r\n// sharedData.ts\r\nexport default {\r\n siteTitle: 'Shared site title',\r\n};\r\n```\r\n\r\n3. Import the module\r\n\u003Cdetails>\r\n\u003Csummary>in \u003Ccode>.vitepress/config.ts\u003C/code>\u003C/summary>\r\n\u003Cpre>\r\nimport { defineConfig } from 'vitepress';\r\nimport sharedData from '#sharedData';\r\nexport default defineConfig({\r\n title: sharedData.siteTitle,\r\n});\r\n\u003C/pre>\r\n\u003C/details>\r\n\u003Cdetails>\r\n\u003Csummary>in a data loader\u003C/summary>\r\n\u003Cpre>\r\nimport { defineLoader } from 'vitepress';\r\nimport sharedData from '#sharedData';\r\nexport default defineLoader({\r\n watch: ['./sharedData.ts'],\r\n load: () => sharedData,\r\n});\r\n\u003C/pre>\r\n\u003C/details>\n\n### Expected behavior\n\n```import sharedData from '#sharedData'```\r\n\r\nshould work identically to \r\n\r\n```import sharedData from '../../sharedData'```\r\n\r\nand set the site title to `Shared site title`.\n\n### System Info\n\n```Text\nSystem:\r\n OS: Linux 5.0 undefined\r\n CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz\r\n Memory: 0 Bytes / 0 Bytes\r\n Shell: 1.0 - /bin/jsh\r\n Binaries:\r\n Node: 18.20.3 - /usr/local/bin/node\r\n Yarn: 1.22.19 - /usr/local/bin/yarn\r\n npm: 10.2.3 - /usr/local/bin/npm\r\n pnpm: 8.15.6 - /usr/local/bin/pnpm\r\n npmPackages:\r\n vitepress: latest => 1.3.4\n```\n\n\n### Additional context\n\nRunning VitePress with Bun (`bun --bun run docs:dev`) or tsx `tsx node_modules/vitepress/bin/vitepress.js` works around the issue.\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.",[2881],{"name":2868,"color":2869},4173,"Site config and data loaders don't support subpath imports","2024-10-12T12:11:42Z","https://github.com/vuejs/vitepress/issues/4173",0.7787317,{"description":2888,"labels":2889,"number":2891,"owner":2871,"repository":2872,"state":2873,"title":2892,"updated_at":2893,"url":2894,"score":2895},"### Is your feature request related to a problem? Please describe.\n\nI started using VitePress a long time ago, about 4 years back. I don't want to waste developers' time listening to me ramble, but the main reason I'm bringing this up is that I've accumulated a lot of notes. \r\n\r\nEvery time I publish a new note, I have to manually add the blog path in Sider, which is really inconvenient! I just want to write notes, and filling in the note path in Sider is a hassle for me. \r\n\r\nOf course, I noticed this issue: https://github.com/vuejs/vitepress/issues/572#issuecomment-1170116225\r\n\r\nBut it seems like it would require more work, which just adds to the burden of writing my notes!\n\n### Describe the solution you'd like\n\nI just want to happily take notes without worrying about file paths. I hope vitepress can intelligently analyze the note paths and stop making the note authors stress over this.\r\n\r\nFor example, if vitepress knows all the locations of my notes, then it should refresh the content of the sider and nav every time it builds.\r\n\r\nPlease don't overlook this issue. Thanks! \r\n\r\nThe number of notes users have keeps increasing over time, and users migrating from other frameworks face this problem even more. They need to manually fill in a lot of sider and nav, which raises their costs. \r\n\r\nPlease don't ignore this issue. Thank you!\n\n### Describe alternatives you've considered\n\nnull\n\n### Additional context\n\nnull\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.",[2890],{"name":2868,"color":2869},4229,"[feature] Request vitepress to automatically generate a sider from the file directory","2024-10-26T17:17:16Z","https://github.com/vuejs/vitepress/issues/4229",0.77873784,{"description":2897,"labels":2898,"number":2902,"owner":2871,"repository":2872,"state":2873,"title":2903,"updated_at":2904,"url":2905,"score":2906},"Why the css and js files import fail after I [npm run build](docs:build)? In other words, the styles are lost and the web pages are messed up.\r\n\r\nWhether or not to set base is the same.\r\n\r\nThe following is the dist without the base (taking example.html as an example):\r\n\u003Cimg width=\"291\" alt=\"image\" src=\"https://github.com/user-attachments/assets/927cdd84-5ff2-4d3f-8f80-9b6f577f4f30\">\r\n\u003Cimg width=\"944\" alt=\"image\" src=\"https://github.com/user-attachments/assets/e8fbac74-3fdb-4754-81e1-6ad024428abc\">\r\n\u003Cimg width=\"1439\" alt=\"image\" src=\"https://github.com/user-attachments/assets/891b39fc-e11e-45b3-b52d-ff3f835ef734\">\r\n\r\nAs long as I change \"href=\"/assets/style.eGqldYn-.css\" to href=\"assets/style.eGqldYn-.css\", the style will return to normal.\r\n\u003Cimg width=\"1436\" alt=\"image\" src=\"https://github.com/user-attachments/assets/ac9e36be-20da-4fc8-bda1-e8c826314c32\">\r\n\r\n\r\nIs there something wrong with the config.ts?\r\n\r\nthanks very much~\r\n\r\n-------------------------------------------------------\r\n为什么我build之后,css和js文件的引入失败呢?也就是说,样式丢失,网页错乱\r\n\r\n无论加不加base属性都是如此。\r\n\r\n以下是没有加base属性的dist文件(以example.html为例):\r\n\u003Cimg width=\"291\" alt=\"image\" src=\"https://github.com/user-attachments/assets/927cdd84-5ff2-4d3f-8f80-9b6f577f4f30\">\r\n\u003Cimg width=\"944\" alt=\"image\" src=\"https://github.com/user-attachments/assets/e8fbac74-3fdb-4754-81e1-6ad024428abc\">\r\n\u003Cimg width=\"1439\" alt=\"image\" src=\"https://github.com/user-attachments/assets/891b39fc-e11e-45b3-b52d-ff3f835ef734\">\r\n\r\n\r\n只要我将 href=\"/assets/style.eGqldYn-.css\" 改成 href=\"assets/style.eGqldYn-.css\",样式就恢复正常了。\r\n\u003Cimg width=\"1436\" alt=\"image\" src=\"https://github.com/user-attachments/assets/ac9e36be-20da-4fc8-bda1-e8c826314c32\">\r\n\r\n是哪里的配置写错了吗?\r\n\r\n非常感谢",[2899],{"name":2900,"color":2901},"need more info","bdbefc",4165,"Why the css and js files import fail after I build? In other words, the styles are lost and the web pages are messed up.","2025-03-02T18:08:41Z","https://github.com/vuejs/vitepress/issues/4165",0.7791049,{"description":2908,"labels":2909,"number":2910,"owner":2871,"repository":2872,"state":2873,"title":2911,"updated_at":2912,"url":2913,"score":2914},"目前的侧边栏似乎有层级限制,好像是五层,更深层的就不会展示了\n",[],4683,"侧边栏最大层级是多少","2025-04-08T10:16:39Z","https://github.com/vuejs/vitepress/issues/4683",0.781334,{"description":2916,"labels":2917,"number":2922,"owner":2871,"repository":2872,"state":2873,"title":2923,"updated_at":2924,"url":2925,"score":2926},"### Describe the bug\n\n# Issue: Cannot download files from public folder in version` v.1.3.4`\r\n\r\n## Description\r\nI encountered an issue after updating **Vitepress** from version `v.1.2.3` to `v.1.3.4` where I can no longer download files from the public folder on my Vitepress site. \r\n\r\n\r\n## Screenshots \r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\n\n### Reproduction\n\n# Steps to reproduce\r\n1. Run Vitepress on Gitlab Pages\r\n2. Update Vitepress from `v.1.2.3` to `v.1.3.4`\r\n3. Attempt to download a file from the public folder. \r\n4. The error message \"file not available on the page\" appears \r\n\r\n\n\n### Expected behavior\n\n# Expected behavior\r\nFiles from the public folder should be downloadable, as they were in version `v.1.2.3`. \r\n\r\n## Workaraound \r\nDowngrading back to `v.1.2.3` resolve the issue and restore file downloads from the public folder. \n\n### System Info\n\n```Text\nVitepress v.1.3.4\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.",[2918,2921],{"name":2919,"color":2920},"bug: pending triage","e99695",{"name":2868,"color":2869},4230,"Download public files - File not available on the page (Gitlab Pages)","2024-10-26T17:17:15Z","https://github.com/vuejs/vitepress/issues/4230",0.781743,{"description":2928,"labels":2929,"number":2931,"owner":2871,"repository":2872,"state":2932,"title":2933,"updated_at":2934,"url":2935,"score":2936},"### Describe the bug\n\n# 问题描述\r\n根据官方文档的描述,如果每个文档页面中的frontmatter没有设置上下页链接,它会根据sidebar侧边栏推断出上下页跳转,在[我的项目](https://i-am-shy.github.io/vitepress/)中,仅仅只是添加了几个文档页面(都是默认最简单的配置并没有使用自定义主题)\r\n\r\n\r\n**错误展示**\r\n\r\n在这个页面(包括后续的页面,它们都被定向到了第一个文档的位置)中没有正确的按照侧边栏推断出上下页\r\n\r\n\r\n\r\n[这里](https://github.com/I-am-shy/vitepress/blob/main/docs/JS/Animation/index.md)查看这个页面的md代码\r\n\r\n\r\n\n\n### Reproduction\n\n可以查看我在github部署的[项目](https://i-am-shy.github.io/vitepress/)\r\n\r\n---\r\n在每个文档页中都是普通的md,并没有设置frontmatter 配置相关的内容\r\n\r\n这是我的config.mts:\r\n```js\r\nimport { defineConfig } from 'vitepress'\r\n\r\n// https://vitepress.dev/reference/site-config\r\nexport default defineConfig({\r\n lang: 'zh-CN',\r\n base: '/vitepress/',\r\n title: \"shy的学习笔记\",\r\n description: \"一个文档网站\",\r\n lastUpdated: true,\r\n head:[\r\n ['link',{ rel: 'icon', href: '/vitepress/favicon.ico' }]\r\n ],\r\n themeConfig: {\r\n // https://vitepress.dev/reference/default-theme-config\r\n nav: [\r\n { text: '主页', link: '/' },\r\n { text: 'md语法', link: '/markdown-examples' },\r\n ],\r\n\r\n sidebar: [\r\n {\r\n text: 'md语法',\r\n items: [\r\n { text: 'Markdown 例子', link: '/markdown-examples' },\r\n { text: '运行时 API 例子', link: '/api-examples' }\r\n ],\r\n collapsed: false\r\n },\r\n {\r\n text: \"JS\",\r\n items:[\r\n {\r\n text: \"浏览器API\",\r\n items: [\r\n { text: \"js实现拍摄和录屏功能\", link: \"/JS/Video\"}\r\n ],\r\n collapsed: true\r\n }, \r\n {\r\n text: \"js动画库\",\r\n items: [\r\n {text: \"popmotion\", link: \"/JS/Animation\"}\r\n ],\r\n collapsed: true\r\n },\r\n {\r\n text: \"ThreeJS 3D模型\",\r\n items:[\r\n { text: \"基本概念\", link: \"/JS/ThreeJS\"},\r\n { text: \"初始化场景模型\", link: \"/JS/ThreeJS/init\"},\r\n { text: \"第一个3D场景模型\", link:\"/JS/ThreeJS/scene\"},\r\n { text: \"几何矩阵\" , link:\"/JS/ThreeJS/geometry\"},\r\n ],\r\n collapsed: true\r\n },\r\n { text: \"js爬虫\", link: \"/JS/Clawler\" },\r\n { text: \"js流\", link: \"/JS/Stream\"},\r\n { text: \"http-server\",link: \"/JS/http-server\"},\r\n { text: \"html转markdown\", link: \"/JS/Turndown\"},\r\n { text: \"2d物理引擎\", link: \"/JS/Matter\"},\r\n ],\r\n collapsed: false\r\n },\r\n {\r\n text: \"TS\",\r\n items:[\r\n {text: \"在任意位置运行ts\", link: \"/TS/run-TS\"}\r\n ],\r\n collapsed: false\r\n },\r\n {\r\n text: \"其他\",\r\n items:[\r\n {text: \"YAML\", link: \"/other/yaml\"}\r\n ],\r\n collapsed: false\r\n }\r\n ],\r\n\r\n socialLinks: [\r\n { icon: 'github', link: 'https://github.com/I-am-shy/vitepress' }\r\n ],\r\n\r\n search: {\r\n provider: 'local'\r\n },\r\n\r\n lastUpdated:{\r\n text: '最后更新时间',\r\n formatOptions: {\r\n dateStyle: 'short',\r\n timeStyle: 'short'\r\n }\r\n },\r\n\r\n\r\n }\r\n})\r\n```\n\n### Expected behavior\n\n自动推断可以在后续的文档项目中减少工作量,希望可以修复这个问题,或者指出我在项目中错误的代码部分,万分感谢😥😥😥\n\n### System Info\n\n```Text\nSystem:\r\n OS: macOS 15.0.1\r\n CPU: (8) arm64 Apple M1\r\n Memory: 136.16 MB / 8.00 GB\r\n Shell: 5.9 - /bin/zsh\r\n Binaries:\r\n Node: 20.17.0 - /usr/local/bin/node\r\n npm: 10.8.2 - /usr/local/bin/npm\r\n Browsers:\r\n Chrome: 131.0.6778.87\r\n Edge: 131.0.2903.70\r\n Safari: 18.0.1\r\n npmPackages:\r\n vitepress: ^1.5.0 => 1.5.0\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.",[2930],{"name":2919,"color":2920},4403,"closed","上下页的自动推断功能异常","2024-12-12T04:45:57Z","https://github.com/vuejs/vitepress/issues/4403",0.71159,{"description":2938,"labels":2939,"number":2941,"owner":2871,"repository":2872,"state":2932,"title":2942,"updated_at":2943,"url":2944,"score":2945},"### Describe the bug\r\n\r\n> 原作者: [https://github.com/xxx](https://github.com/xxx)\r\n### Reproduction\r\n\r\n-\r\n\r\n### Expected behavior\r\n\r\n-\r\n\r\n### System Info\r\n\r\n```Text\r\n-\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.",[2940],{"name":2900,"color":2901},4013,"Blockquotes support this style?","2024-07-11T04:42:22Z","https://github.com/vuejs/vitepress/issues/4013",0.723461,{"description":2947,"labels":2948,"number":2949,"owner":2871,"repository":2872,"state":2932,"title":2950,"updated_at":2951,"url":2952,"score":2953},"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,"How to add register language/grammar for shiki?","2023-01-21T14:25:07Z","https://github.com/vuejs/vitepress/issues/1331",0.7540082,{"description":2955,"labels":2956,"number":2957,"owner":2871,"repository":2872,"state":2932,"title":2958,"updated_at":2959,"url":2960,"score":2961},"I scanned the repository and there are two dependencies that are redundant, can they be removed?\r\n\r\n1. enquirer\r\n2. supports-color",[],2397,"Whether to remove redundant dependencies","2023-06-02T00:04:15Z","https://github.com/vuejs/vitepress/issues/2397",0.7543087,["Reactive",2963],{},["Set"],["ShallowReactive",2966],{"$fTRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"$fM-Bpc7ZosH6RoBmty0SU1DgBZ26EwpINcaGip-r6RUQ":-1},"/vuejs/vitepress/4516"]