\n\n\u003Cimg width=\"308\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/0e1beb6b-d06b-436c-b106-c924fead87ab\" />\n\n\u003Cimg width=\"931\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/aef6f71a-fa28-4b7c-b512-e6386e18159a\" />\n\n### Describe the solution you'd like\n\nIn my [pull request](https://github.com/vuejs/vitepress/pull/4630), I've introduced custom components that can be overridden in the `enhanceApp` function. In these custom components, I can add custom logic for rendering text, such as using the Vue compile function. \n\nAdditionally, I added a flag to skip the title update, allowing for custom logic implementation. \n\nPlease also see my PR: [https://github.com/vuejs/vitepress/pull/4630](https://github.com/vuejs/vitepress/pull/4630).\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.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.",[],4637,"Sidenav Components / Skip title update","2025-03-20T12:17:14Z","https://github.com/vuejs/vitepress/issues/4637",0.7765658,{"description":3038,"labels":3039,"number":3046,"owner":3022,"repository":3023,"state":3024,"title":3047,"updated_at":3048,"url":3049,"score":3050},"### Is your feature request related to a problem? Please describe.\r\n\r\nTo inject HTML tags in a page's `\u003Chead>`, as far as I understand the solution is to use the `head` or `transformHead` options.\r\n\r\nMy issue is that I’d like to reference assets in the `\u003Chead>`, for instance to link to a SVG favicon (same image for all pages) or to an opengraph image (different image for each page).\r\n\r\nCurrently I’m handling this by using absolute paths from the root of the domain, and put those images in the `public/img` folder. So the config might look like:\r\n\r\n```js\r\nexport default {\r\n head: [\r\n ['meta', { rel: 'icon', type: 'image/svg+xml', href: `/img/theme/favicon.svg` }]\r\n ],\r\n transformHead({ pageData }) {\r\n const { og_image } = pageData.frontmatter;\r\n if (og_image) {\r\n return [['meta', {property: 'og:image', content: `/img/og/${og_image}` }]];\r\n }\r\n }\r\n}\r\n```\r\n\r\nHere the downsides are:\r\n\r\n- If we change the `base` URL and need to serve all assets under the base path, e.g. `/{base}/img/…`, we have to go back to this config and chose those hardcoded URLs.\r\n- Those assets won't have a cache-busting hash in their file name.\r\n- Missing assets are not caught at build time.\r\n\r\n\r\n### Describe the solution you'd like\r\n\r\nIt would be great if we could use Vite to handle those assets.\r\n\r\nCurrently that's not possible in `.vitepress/config.js`, since this is executed in a Node.js context and special bundler imports like `import svgFaviconUrl from './img/favicon.svg';` won't work.\r\n\r\nI wonder if that's something that could be done in the `transformHead` hook or in a different hook. If not, that's fine, I can live with the workarounds; but I just thought I'd ask.\r\n\r\n### Describe alternatives you've considered\r\n\r\nOne possible workaround would be to load those assets *somewhere*, maybe in a custom layout component, to register those assets in the Vite assets.\r\n\r\nThen in the `transformHead` hook, you actually have access to a `context.assets` array, which can look like:\r\n\r\n```js\r\n[\r\n '/assets/abcd.77593610.png',\r\n '/assets/efgh.2984b36b.gif',\r\n '/assets/ijkl.5e11e538.gif',\r\n '/assets/mnop.afe27ee2.png',\r\n // …\r\n]\r\n```\r\n\r\nThat's *almost* usable, but because it's not a manifest which also shows the original paths, it's hard to resolve the correct paths. If I’m looking for `.vitepress/theme/img/favicon.svg`, and there is another `favicon.svg` somewhere else in the assets, how do I know if I should use `/assets/favicon.2e0fc5e5.svg` or `/assets/favicon.c7ab5b73.svg`?\r\n\r\nSo I’m wondering, if the Vite manifest available at this point, and could it be exposed in the `context` for the `transformHead` hook?\r\n\r\nOr is that something that is too low-level for `transformHead`, and it should be a custom Vite plugin instead?\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.",[3040,3043],{"name":3041,"color":3042},"build","377ba8",{"name":3044,"color":3045},"stale","ededed",3161,"Accessing Vite asset URLs in head config","2025-03-02T18:10:24Z","https://github.com/vuejs/vitepress/issues/3161",0.7777849,{"description":3052,"labels":3053,"number":3055,"owner":3022,"repository":3023,"state":3024,"title":3056,"updated_at":3057,"url":3058,"score":3059},"### Is your feature request related to a problem? Please describe.\n\n1. sometimes need use vue dynamic render highlight content like json list or some thing . if can provide component or function to do that, that will be great.\r\n2. tryed use the vue dynamic component it's not woking , can we use it ? how.\r\n1.有时候需要动态输出 markdown ,能不能加一个从vue 动态输出的功能 。 2. 动态组件用不了,怎么才能用vue 的动态组件\n\n### Describe the solution you'd like\n\n1. sometimes need use vue dynamic render highlight content like json list or some thing . if can provide component or function to do that, that will be great.\r\n2. tryed use the vue dynamic component it's not woking , can we use it ? how.\r\n1.有时候需要动态输出 markdown ,能不能加一个从vue 动态输出的功能 。 2. 动态组件用不了,怎么才能用vue 的动态组件\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.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.",[3054],{"name":3044,"color":3045},4253,"[Feature request] use vue render highlight section","2024-12-03T17:27:43Z","https://github.com/vuejs/vitepress/issues/4253",0.7848404,{"description":3061,"labels":3062,"number":3066,"owner":3022,"repository":3023,"state":3067,"title":3068,"updated_at":3069,"url":3070,"score":3071},"### Describe the bug\n\n例如:引入import AceEditor from '@/components/aceEditor/index.vue'这个组件页面热更新失效,去掉则正常\r\n\r\n\n\n### Reproduction\n\n略\n\n### Expected behavior\n\n期待引入子组件后页面热更新也正常\n\n### System Info\n\n```shell\n略\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.",[3063],{"name":3064,"color":3065},"need more info","bdbefc",1481,"closed","vue3+vite 页面引入子组件后热更新失效,去掉该子组件后页面热更新正常","2023-01-21T14:20:44Z","https://github.com/vuejs/vitepress/issues/1481",0.77231616,{"description":3073,"labels":3074,"number":3078,"owner":3022,"repository":3023,"state":3067,"title":3079,"updated_at":3080,"url":3081,"score":3082},"### Describe the bug\r\n\r\nYou can check Reproduction Url test.\r\n\r\nEverything works fine when I start the vite project(`apps/playground`) using `pnpm dev:playground`. It crashed when I started vitepress project(`apps/document`) using `pnpm dev:document`.\r\n\r\nMy monorepo project uses `node condition` to link the source code. You can check the `dev` field in `package.json` or `condition: [\"dev\"]` in `vite.config.ts` or `condition: [\"dev\"]` in `config.ts`.\r\n\r\n### Reproduction\r\n\r\nhttps://github.com/i7eo/monorepo-vitepress-bug-report\r\n\r\n### Expected behavior\r\n\r\nStart normally like a vite project(`apps/playground`)\r\n\r\n### System Info\r\n\r\n```Text\r\nSystem:\r\n OS: macOS 14.4.1\r\n CPU: (10) arm64 Apple M1 Max\r\n Memory: 3.61 GB / 64.00 GB\r\n Shell: 5.9 - /bin/zsh\r\n Binaries:\r\n Node: 20.12.2 - ~/.nvm/versions/node/v20.12.2/bin/node\r\n npm: 10.5.0 - ~/.nvm/versions/node/v20.12.2/bin/npm\r\n pnpm: 9.1.0 - ~/.nvm/versions/node/v20.12.2/bin/pnpm\r\n Watchman: 2024.04.08.00 - /opt/homebrew/bin/watchman\r\n Browsers:\r\n Chrome: 124.0.6367.201\r\n Safari: 17.4.1\r\n Safari Technology Preview: 17.4\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.",[3075],{"name":3076,"color":3077},"bug: pending triage","e99695",3888,"Vitepress project in monorepo reports `Failed to resolve import \"xxx\"`","2024-05-22T04:41:52Z","https://github.com/vuejs/vitepress/issues/3888",0.777446,{"description":3084,"labels":3085,"number":3087,"owner":3022,"repository":3023,"state":3067,"title":3088,"updated_at":3089,"url":3090,"score":3091},"### Describe the bug\n\nBuild failed\n\n### Reproduction\n\nclone [vitepress-template](https://github.com/Tyh2001/vitepress-template)\r\n\r\n```shell\r\npnpm i\r\n\r\npnpm build\r\n```\r\n\r\nI'm not sure if the mistake is `vitepress` or [fighting-design](https://github.com/FightingDesign/fighting-design)\r\n\r\nerr message:\r\n\r\n```shell\r\n> vitepress-template@ build D:\\项目-我的\\vitepress-template\r\n D:\\项目-我的\\vitepress-template\\node_modules\\.pnpm\\fighting-design@0.8.0-alpha.5\\node_modules\\fighting-design\\es\\index.js:1 \r\nimport \"./index2.js\";\r\n^^^^^^\r\n\r\nSyntaxError: Cannot use import statement outside a module\r\n at Object.compileFunction (node:vm:352:18)\r\n at wrapSafe (node:internal/modules/cjs/loader:1033:15)\r\n at Module._compile (node:internal/modules/cjs/loader:1069:27)\r\n at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)\r\n at Module.load (node:internal/modules/cjs/loader:981:32)\r\n at Function.Module._load (node:internal/modules/cjs/loader:822:12)\r\n at ModuleWrap.\u003Canonymous> (node:internal/modules/esm/translators:170:29)\r\n at ModuleJob.run (node:internal/modules/esm/module_job:198:25)\r\n at async Promise.all (index 0)\r\n at async ESMLoader.import (node:internal/modules/esm/loader:385:24)\r\n ELIFECYCLE Command failed with exit code 1.\r\n```\r\n\n\n### Expected behavior\n\nBuild successful\n\n### System Info\n\n```shell\n\"vitepress\": \"1.0.0-alpha.27\",\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.",[3086],{"name":3076,"color":3077},1579,"Build error","2023-01-21T14:20:51Z","https://github.com/vuejs/vitepress/issues/1579",0.7782285,{"description":3093,"labels":3094,"number":3095,"owner":3022,"repository":3023,"state":3067,"title":3096,"updated_at":3097,"url":3098,"score":3099},"### Is your feature request related to a problem? Please describe.\n\nI use page hrefs in dynamic `\u003Cmeta>` tags, for example in `og:url`. It'd be great if VitePress provided a way to reliably reference the page's pathname, to ensure that that part of the dynamic meta content is correct.\n\n### Describe the solution you'd like\n\nExport this function: https://github.com/vuejs/vitepress/blob/452d6c77a6afa43faa245452e7d0b360e55a36fb/src/shared/shared.ts#L65\r\n\n\n### Describe alternatives you've considered\n\nCurrently, I copy `normalize`, `HASH_OR_QUERY_RE`, and `INDEX_OR_EXT_RE` from `src/shared/shared.ts` to my VitePress config. That's brittle and inelegant.\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.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.",[],4401,"feature request: export src/shared/shared's normalize()","2025-01-28T04:42:53Z","https://github.com/vuejs/vitepress/issues/4401",0.7794997,{"description":3101,"labels":3102,"number":3106,"owner":3022,"repository":3023,"state":3067,"title":3107,"updated_at":3108,"url":3109,"score":3110},"### Describe the bug\r\n\r\nFail to install with yarn in windows, if the folder is not in C drive\r\n\r\n### Reproduction\r\n\r\nOn a folder is not in C drive:\r\n\r\n```sh\r\nyarn init\r\nyarn add -D vitepress vue\r\nyarn vitepress init\r\nyarn run docs:dev\r\n```\r\n\r\nGet this error\r\n\r\n```\r\n vitepress v1.3.1\r\n\r\n ➜ Local: http://localhost:5173/\r\n ➜ Network: use --host to expose\r\n ➜ press h to show help\r\n✘ [ERROR] Could not read from file: E:/Data/note-vitepress/.yarn/__virtual__/vue-virtual-80b135f193/4/C:/Users/User/AppData/Local/Yarn/Berry/cache/vue-npm-3.4.34-9d9c80aee1-10c0.zip/node_modules/vue/dist/vue.runtime.esm-bundler.js\r\n\r\n✘ [ERROR] Could not read from file: E:\\Data\\note-vitepress\\.yarn\\__virtual__\\vitepress-virtual-046653f2bc\\4\\C:\\Users\\User\\AppData\\Local\\Yarn\\Berry\\cache\\vitepress-npm-1.3.1-f5fb335031-10c0.zip\\node_modules\\vitepress\\lib\\vue-demi.mjs\r\n\r\n C:/Users/User/AppData/Local/Yarn/Berry/cache/@vueuse-core-npm-10.11.0-fb26847db9-10c0.zip/node_modules/@vueuse/core/index.mjs:3:320:\r\n 3 │ ...xtTick, reactive, markRaw, unref, getCurrentScope, set, del, isReadonly, onBeforeUpdate } from 'vue-demi';\r\n ╵ ~~~~~~~~~~\r\n```\r\n\r\n\r\n### Expected behavior\r\n\r\nNo issue\r\n\r\n### System Info\r\n\r\n```Text\r\nSystem:\r\n OS: Windows 10 10.0.19045\r\n CPU: (4) x64 Intel(R) Core(TM) i5-4570 CPU @ 3.20GHz\r\n Memory: 1.03 GB / 7.92 GB\r\n Binaries:\r\n Node: 20.15.0 - ~\\AppData\\Local\\Volta\\tools\\image\\node\\20.15.0\\node.EXE\r\n Yarn: 4.3.1 - ~\\AppData\\Local\\Volta\\tools\\image\\yarn\\4.3.1\\bin\\yarn.CMD\r\n npm: 10.7.0 - ~\\AppData\\Local\\Volta\\tools\\image\\node\\20.15.0\\npm.CMD\r\n bun: 1.1.21 - ~\\.bun\\bin\\bun.EXE\r\n Browsers:\r\n Chrome: 127.0.6533.73\r\n Edge: Chromium (127.0.2651.74)\r\n Internet Explorer: 11.0.19041.4355\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.",[3103],{"name":3104,"color":3105},"upstream","BF29ED",4091,"Fail to install with yarn in windows, if the folder is not in C drive","2024-08-09T04:42:09Z","https://github.com/vuejs/vitepress/issues/4091",0.7795411,{"description":3112,"labels":3113,"number":3115,"owner":3022,"repository":3023,"state":3067,"title":3116,"updated_at":3117,"url":3118,"score":3119},"测试代码如下:\n````\n```js\nexport default {\n foo: { // [!code ++]\n // 这是一些注释 \n bar:'test' // [!code ++]\n }, // [!code ++]\n};\n```\n````\n效果展示\n\n\n\n此时,如果我们也想要注释的那一行也拥有高亮着色效果,我们还需要在注释的后面再补充一个注释符号`//`才有效果\n````\n```js\nexport default {\n foo: { // [!code ++]\n // 这是一些注释 // [!code ++]\n bar:'test' // [!code ++]\n }, // [!code ++]\n};\n```\n````\n\n\n\n主要讨论的是,如果已经是注释了,是否可以直接在末尾添加`[!code ++]`就可以达到上面相同的效果\n````\n```js\nexport default {\n foo: { // [!code ++]\n // 这是一些注释 [!code ++]\n bar:'test' // [!code ++]\n }, // [!code ++]\n};\n```\n````\n\n\n这算不算是一个可以优化的点?希望一起讨论一下\n\n\n",[3114],{"name":3104,"color":3105},4614,"讨论:对于已经是注释的行的代码差异标记是否应该不再需要再添加多余的注释标记?","2025-03-17T04:44:40Z","https://github.com/vuejs/vitepress/issues/4614",0.7804416,["Reactive",3121],{},["Set"],["ShallowReactive",3124],{"$fTRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"$fYoyj-7XupX5OkMonCy0Jd-LmXFkAH4wkR1S_oDz6rew":-1},"/vuejs/vitepress/3783"]