```\r\n\r\nIt doesn't seem to be correct:\r\n\r\n\r\n\r\nHow to make it look correct, just like on the homepage?:\r\n\r\n\r\n\r\n",[2914],{"name":2871,"color":2872},4273,"How to use default Vue components elsewhere","2024-12-03T17:27:39Z","https://github.com/vuejs/vitepress/issues/4273",0.75902396,{"description":2921,"labels":2922,"number":2927,"owner":2874,"repository":2875,"state":2876,"title":2928,"updated_at":2929,"url":2930,"score":2931},"I hit another case of #449 by including the following in a markdown file. The workaround which linked to #662 worked for me. Perhaps this should be off by default? Or detect the compilation error and bring a suggestion? The XML I included seems pretty straightforward. Would have been very hard to diagnose if I hadn't been doing lots of searches against the issues here. \r\n\r\n```xml\r\n\u003Ckeyboard locale=\"mt\" conformsTo=\"techpreview\">\r\n \u003Ckeys>\r\n \u003Ckey id=\"hmaqtugha\" to=\"ħ\" />\r\n \u003Ckey id=\"that\" to=\"ថា\" />\r\n \u003C/keys>\r\n\r\n \u003Clayers form=\"hardware\">\r\n \u003Clayer id=\"base\">\r\n \u003Crow keys=\"hmaqtugha that\" />\r\n \u003C/layer>\r\n \u003C/layers>\r\n\r\n\u003C/keyboard>\r\n```\r\n\r\nSymptom is an error deep inside vue\r\n\r\n```\r\n5:26:34 PM [vitepress] Internal server error: Duplicate attribute.\r\n Plugin: vite:vue\r\n File: /Users/srl295/src/codehivetx.us/en/posts/2022-kbd-progress.md:22:69\r\n 22 | \u003Ckeys>\r\n 23 | \u003Ckey id=\"hmaqtugha\" to=\"ħ\" />\r\n 24 | \u003Ckey id=\"that\" to=\"ថា\" />\r\n | ^\r\n 25 | \u003C/keys>\r\n 26 | \r\n at createCompilerError (/Users/srl295/src/codehivetx.us/node_modules/@vue/compiler-core/dist/compiler-core.cjs.js:1327:17)\r\n at emitError (/Users/srl295/src/codehivetx.us/node_modules/@vue/compiler-core/dist/compiler-core.cjs.js:2805:5)\r\n at Object.onattribnameend (/Users/srl295/src/codehivetx.us/node_modules/@vue/compiler-core/dist/compiler-core.cjs.js:2290:7)\r\n at Tokenizer.handleAttrNameEnd (/Users/srl295/src/codehivetx.us/node_modules/@vue/compiler-core/dist/compiler-core.cjs.js:872:14)\r\n at Tokenizer.stateInAttrName (/Users/srl295/src/codehivetx.us/node_modules/@vue/compiler-core/dist/compiler-core.cjs.js:812:12)\r\n at Tokenizer.parse (/Users/srl295/src/codehivetx.us/node_modules/@vue/compiler-core/dist/compiler-core.cjs.js:1065:16)\r\n at Object.baseParse (/Users/srl295/src/codehivetx.us/node_modules/@vue/compiler-core/dist/compiler-core.cjs.js:2844:13)\r\n at Object.parse (/Users/srl295/src/codehivetx.us/node_modules/@vue/compiler-dom/dist/compiler-dom.cjs.js:698:23)\r\n at Object.parse$2 [as parse] (/Users/srl295/src/codehivetx.us/node_modules/@vue/compiler-sfc/dist/compiler-sfc.cjs.js:1846:24)\r\n at createDescriptor (file:///Users/srl295/src/codehivetx.us/node_modules/@vitejs/plugin-vue/dist/index.mjs:74:43) (x2)\r\n```\r\n",[2923,2926],{"name":2924,"color":2925},"build","377ba8",{"name":2871,"color":2872},3401,"better stack trace / error message for markdown-it-attrs failures","2025-03-02T18:10:00Z","https://github.com/vuejs/vitepress/issues/3401",0.76961136,{"description":2933,"labels":2934,"number":2937,"owner":2874,"repository":2875,"state":2876,"title":2938,"updated_at":2939,"url":2940,"score":2941},"### 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.",[2935,2936],{"name":2924,"color":2925},{"name":2871,"color":2872},3161,"Accessing Vite asset URLs in head config","2025-03-02T18:10:24Z","https://github.com/vuejs/vitepress/issues/3161",0.77511936,{"description":2943,"labels":2944,"number":2948,"owner":2874,"repository":2875,"state":2949,"title":2950,"updated_at":2951,"url":2952,"score":2953},"### 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.",[2945],{"name":2946,"color":2947},"bug: pending triage","e99695",3888,"closed","Vitepress project in monorepo reports `Failed to resolve import \"xxx\"`","2024-05-22T04:41:52Z","https://github.com/vuejs/vitepress/issues/3888",0.7320595,{"description":2955,"labels":2956,"number":2957,"owner":2874,"repository":2875,"state":2949,"title":2958,"updated_at":2959,"url":2960,"score":2961},"### Describe the bug\n\nVitePress ignores the `vite.clearScreen: false` option - running `vitepress build` will clear the screen regardless.\r\n\r\nThis is causing issues in our turbo build monorepo - when building several packages at once, VitePress's clear screen clears the log output for packages that were built before it.\n\n### Reproduction\n\nhttps://stackblitz.com/edit/vite-dtu41vnr?file=package.json\r\n\r\n1. Install dependencies\r\n2. Run `npx vitepress build docs`\r\n3. See that screen is cleared, despite vite.clearScreen:false in docs/.vitepress/config.ts\n\n### Expected behavior\n\nScreen should not be cleared if vite.clearScreen:false is set\n\n### System Info\n\n```Text\nSystem:\r\n OS: macOS 15.2\r\n CPU: (10) arm64 Apple M1 Pro\r\n Memory: 78.41 MB / 32.00 GB\r\n Shell: 5.9 - /bin/zsh\r\n Binaries:\r\n Node: 22.12.0 - ~/.local/state/fnm_multishells/64248_1736184870871/bin/node\r\n Yarn: 1.22.19 - ~/.local/state/fnm_multishells/64248_1736184870871/bin/yarn\r\n npm: 10.9.0 - ~/.local/state/fnm_multishells/64248_1736184870871/bin/npm\r\n Browsers:\r\n Chrome: 131.0.6778.205\r\n Safari: 18.2\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.",[],4468,"`vite.clearScreen: false` option is ignorred","2025-01-14T04:42:24Z","https://github.com/vuejs/vitepress/issues/4468",0.7429042,{"description":2963,"labels":2964,"number":2968,"owner":2874,"repository":2875,"state":2949,"title":2969,"updated_at":2970,"url":2971,"score":2972},"### Describe the bug\n\nI want to use VitePress to generate some static HTML pages, and I hope these HTML files can be opened directly with a browser by double-clicking, without the need for a web server. But after run `npm run docs:build`, and open the HTML file in Chrome, there came an error in Network panel, `Name: inter-roman-latin.bvIUbFQP.woff2`, `Status: (failed)net::ERR_FILE_NOT_FOUND`.\r\n\r\n\r\nIn `.vitepress/dist/assets/style.SZl3QJfs.css`, you can see the url of file `inter-roman-latin.bvIUbFQP.woff2` is `/assets/inter-roman-latin.bvIUbFQP.woff2` but not `./assets/inter-roman-latin.bvIUbFQP.woff2`. This might be the cause of the error.\r\n\r\n\r\n\n\n### Reproduction\n\nRun the command:\r\n\r\n```\r\nnpm install --save-dev vitepress\r\n\r\nnpx vitepress init\r\n\r\n Where should VitePress initialize the config?\r\n ./\r\n\r\n Site title:\r\n My Awesome Project\r\n\r\n Site description:\r\n A VitePress Site\r\n\r\n Theme:\r\n Default Theme (Out of the box, good-looking docs)\r\n\r\n Use TypeScript for config and theme files?\r\n No\r\n\r\n Add VitePress npm scripts to package.json?\r\n Yes\r\n```\r\n\r\nEdit `.vitepress/config.mjs`, add `base : '.'` and `mpa : true`:\r\n\r\n```\r\nimport { defineConfig } from 'vitepress'\r\n\r\n// https://vitepress.dev/reference/site-config\r\nexport default defineConfig({\r\n title: \"My Awesome Project\",\r\n description: \"A VitePress Site\",\r\n themeConfig: {\r\n // https://vitepress.dev/reference/default-theme-config\r\n nav: [\r\n { text: 'Home', link: '/' },\r\n { text: 'Examples', link: '/markdown-examples' }\r\n ],\r\n\r\n sidebar: [\r\n {\r\n text: 'Examples',\r\n items: [\r\n { text: 'Markdown Examples', link: '/markdown-examples' },\r\n { text: 'Runtime API Examples', link: '/api-examples' }\r\n ]\r\n }\r\n ],\r\n\r\n socialLinks: [\r\n { icon: 'github', link: 'https://github.com/vuejs/vitepress' }\r\n ]\r\n },\r\n base : '.',\r\n mpa : true\r\n})\r\n```\r\n\r\nAnd build the docs:\r\n\r\n```\r\nnpm run docs:build\r\n```\r\n\r\nOpen the file `.vitepress/dist/api-examples.html` in Chrome by double-clicking, and then open the Network panel of Chrome's DevTools to see the error.\n\n### Expected behavior\n\nAfter set `base : '.'` in `config.mjs`, the url of assets should start with `./assets/`, but not `/assets/`.\r\n\n\n### System Info\n\n```Text\nSystem:\r\n OS: Linux 6.1 Debian GNU/Linux 12 (bookworm) 12 (bookworm)\r\n CPU: (4) x64 Intel(R) Core(TM) i5-5200U CPU @ 2.20GHz\r\n Memory: 10.44 GB / 15.52 GB\r\n Container: Yes\r\n Shell: 3.6.0 - /usr/bin/fish\r\n Binaries:\r\n Node: 18.17.1 - ~/dev/nodejs/nodejs/bin/node\r\n npm: 10.4.0 - ~/dev/nodejs/nodejs/bin/npm\r\n Browsers:\r\n Chrome: 112.0.5615.165\r\n npmPackages:\r\n vitepress: ^1.0.0-rc.42 => 1.0.0-rc.42\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.",[2965],{"name":2966,"color":2967},"wont fix","EDEED1",3563,"The link in css file is not correct after setting base to '.' in config.mjs","2024-02-16T00:04:27Z","https://github.com/vuejs/vitepress/issues/3563",0.7596568,["Reactive",2974],{},["Set"],["ShallowReactive",2977],{"$fTRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"$fFu_rUQ_uGxOj3GJnXJWwnB6ZpJOJSGCfj4DeLe0o_I4":-1},"/vuejs/vitepress/3852"]