\n \u003C/template>\n \u003C/Layout>\n\u003C/template>\n\n\u003Cscript setup>\nimport DefaultTheme from 'vitepress/theme'\nimport AllArticles from './AllArticles.vue';\nconst Layout = DefaultTheme.Layout;\n\u003C/script>\n```\n\n```\n\u003Ctemplate>\n \u003CArticleGroup title=\"Other articles\" :articles=\"otherArticles.filter(article => article.url !== currentPagePath)\"/>\n\u003C/template>\n\n\n\u003Cscript setup>\nimport { useData } from 'vitepress';\n\nconst data = useData();\n\nconst page = data.page.value;\nlet currentPagePath = page.relativePath.replace(\".md\", \"\");\n\nlet otherArticles = [\n {url: \"page1\", title: \"Page 1\"},\n {url: \"page2\", title: \"Page 2\"},\n {url: \"page3\", title: \"Page 3\"},\n];\n```\n\nThis works fine and when I am on page 1, it only displays pages 2+3. But clicking on page 2 does not reload the component and pages 2+3 are still displayed at the end of page 2 (instead of pages 1+3).\n\nIs there a way to make the component reload upon page change (shouldn't it be reloaded by default if it is in the doc-bottom slot?), or to make the component aware of when the path changes?\n",[],4878,"How to make useData() reactive with page change?","2025-08-03T04:59:12Z","https://github.com/vuejs/vitepress/issues/4878",0.7144812,{"description":3078,"labels":3079,"number":3081,"owner":3033,"repository":3034,"state":3053,"title":3082,"updated_at":3083,"url":3084,"score":3085},"### Describe the bug\r\n\r\nWhen following the documentation for extending the default theme; importing the theme and exported the extended theme results in the error `TS2708: Cannot use namespace 'DefaultTheme' as a value.`.\r\n\r\n\r\n### Reproduction\r\n\r\nIn a bare VitePress installation:\r\n\r\n`docs/.vitepress/theme/index.ts`\r\n```ts\r\nimport { DefaultTheme } from \"vitepress/theme\";\r\n\r\nexport default {\r\n extends: DefaultTheme\r\n}\r\n```\r\n\r\n`docs/.vitepress/theme/index.ts:4:11: TS2708: Cannot use namespace 'DefaultTheme' as a value.`\r\n\r\n### Expected behavior\r\n\r\nThe documented code would work.\r\n\r\n### System Info\r\n\r\n```sh\r\n System:\r\n OS: Linux 6.1 Manjaro Linux\r\n CPU: (12) x64 AMD Ryzen 5 2600 Six-Core Processor\r\n Memory: 17.45 GB / 31.30 GB\r\n Container: Yes\r\n Shell: 5.9 - /bin/zsh\r\n Binaries:\r\n Node: 16.20.0 - ~/.local/bin/node\r\n Yarn: 1.22.19 - ~/.local/bin/yarn\r\n npm: 9.6.5 - ~/.local/bin/npm\r\n Browsers:\r\n Chromium: 114.0.5735.133\r\n npmPackages:\r\n vitepress: ^1.0.0-beta.3 => 1.0.0-beta.3 \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.",[3080],{"name":3062,"color":3063},2532,"Cannot create theme with TypeScript: TS2708: Cannot use namespace 'DefaultTheme' as a value.","2023-06-28T00:04:53Z","https://github.com/vuejs/vitepress/issues/2532",0.7160383,{"description":3087,"labels":3088,"number":3089,"owner":3033,"repository":3034,"state":3053,"title":3090,"updated_at":3091,"url":3092,"score":3093},"### Is your feature request related to a problem? Please describe.\n\nWhen the user configures build hooks, the theme's build hooks are overwritten.\r\n\r\n当用户配置 build hooks 时, 会覆盖掉主题的 build hooks.\n\n### Describe the solution you'd like\n\nFor example, when there is a `transformHead` in the theme, the user adds a `transformHead` in their configuration to override the processing of the theme and has to handle it as follows: Is it possible to place this processing inside `vitepress`?\r\n\r\n以为 `transformHead` 为例, 当主题里存在 `transformHead` , 用户在自己配置里添加 `transformHead` 会覆盖掉主题的处理, 不得不像下面那样处理, 能否将这种处理放置在 `vitepress` 内部处理呢?\r\n\r\n``` ts\r\n// user config\r\nimport Config from 'vitepress-theme-xxx';\r\n\r\n{\r\n async transformHead(content) {\r\n const { transformHead } = await Config()\r\n if (transformHead) {\r\n\t transformHead(content)\r\n }\r\n // do something\r\n }\r\n}\r\n```\r\n---\r\n\r\nIt seems that useRouter's `onBeforeRouteChange` will also exist in `vitepress`, and overrides will also exist when multiple internal components declare onBeforeRouteChange\r\n\r\n\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- [ ] Check that there isn't already an issue that asks for the same feature to avoid creating a duplicate.",[],3109,"When the user configures build hooks, the theme's build hooks are overwritten","2023-10-28T00:04:01Z","https://github.com/vuejs/vitepress/issues/3109",0.7168563,{"description":3095,"labels":3096,"number":3097,"owner":3033,"repository":3034,"state":3053,"title":3098,"updated_at":3099,"url":3100,"score":3101},"### Describe the bug\n\nAfter upgrading to version 2.0.0-alpha7, pages in createContentLoader is rendered asynchronously, the docs seem to be wrong.\n\n### Reproduction\n\nTo minimize disruption, I pasted the example codes to my project, and the issue is still existing.\n\n```posts.data.js\nimport { createContentLoader } from 'vitepress'\n\nexport default createContentLoader('posts/*.md', {\n includeSrc: true, // include raw markdown source?\n render: true, // include rendered full page HTML?\n excerpt: true, // include excerpt?\n transform(rawData) {\n // map, sort, or filter the raw data as you wish.\n // the final result is what will be shipped to the client.\n return rawData.sort((a, b) => {\n return +new Date(b.frontmatter.date) - +new Date(a.frontmatter.date)\n }).map((page) => {\n page.src // raw markdown source\n page.html // rendered full page HTML\n page.excerpt // rendered excerpt HTML (content above first `---`)\n return {/* ... */}\n })\n }\n})\n```\n\n```posts.html\n\u003Cscript setup>\nimport { data as posts } from './posts.data.js'\n\u003C/script>\n\n\u003Cbody>\n \u003Ch1>All Blog Posts\u003C/h1>\n \u003Cul>\n \u003Cli v-for=\"post of posts\">\n \u003Ca :href=\"post.url\">{{ post.frontmatter.title }}\u003C/a>\n \u003Cspan>by {{ post.frontmatter.author }}\u003C/span>\n \u003C/li>\n \u003C/ul>\n\u003Cbody>\n```\n\n### Expected behavior\n\nThe post list should not be empty.\n\n### System Info\n\n```Text\nSystem:\n OS: Windows 11 10.0.26100\n CPU: (12) x64 13th Gen Intel(R) Core(TM) i7-13700K\n Memory: 4.18 GB / 11.98 GB \nBinaries:\n Node: 22.17.0 - C:\\Program Files\\nodejs\\node.EXE\n npm: 11.4.2 - C:\\Program Files\\nodejs\\npm.CMD\nBrowsers:\n Edge: Chromium (129.0.2792.65)\nnpmPackages:\n vitepress: ^2.0.0-alpha.7 => 2.0.0-alpha.7\n```\n\n### Additional context\n\nI have checked following steps:\n\n- Codes I copied are not modified except path.\n- The paths are correct.\n- The file list is not empty.\n\nIf you can not reproduct the issue, I can provide my project.\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.",[],4822,"docs issue in createContentLoader","2025-07-03T05:06:00Z","https://github.com/vuejs/vitepress/issues/4822",0.722552,{"description":3103,"labels":3104,"number":3105,"owner":3033,"repository":3034,"state":3053,"title":3106,"updated_at":3107,"url":3108,"score":3109},"### Is your feature request related to a problem? Please describe.\n\nI'm working on a vitepress site that uses a custom theme. Some time ago, another contributor added local search to the site.\r\nHe did this by enabling search in the config and then importing the `VPNavBarSearch` from `vitepress/dist/client/theme-default/components/VPNavBarSearch.vue`\r\n\r\nThis works. However, I don't believe it's best practice. The thing that is particularly annoying is that it generates a bunch of typescript errors and I'm hoping to get my docs build to be typescript clean and enforce that. The typescript team seems adamantly against enabling the kind of error supression that would enable this scenario and reinforces the concept that they don't believe importing *.ts files (presumably this includes *.vue files with script = \"ts\") in this issue: https://github.com/microsoft/TypeScript/issues/40426\n\n### Describe the solution you'd like\n\nOne possible solution is for VitePress to export `VPNavBarSearch` and possibly other related components.\r\nI monkey patched vitepress to export the component `VPNavBarSearch` and then added it to the normal imports from vitepress e.g. `import { ..., VPNavBarSearch, ...} from 'vitepress'` to prove to myself that this works, including getting rid of the typescript error.\n\n### Describe alternatives you've considered\n\nThe other alternative I briefly explored was moving to use the default theme with customizations, but the default Layout doesn't do everything that I'd like, even with liberal use of the slots.\r\n\r\n(Most) of the reason the typescript is complaining is that I have noexplicit any set and it looks like vitepress doesn't, so it might be possible to make the vitepress components comply with stricter typescript config and have the direct import work, but I think this is a less desireable solution, since as noted above the typescript team doesn't believe this kind of import is best practice.\n\n### Additional context\n\nI've pasted the errors I'm seeing below. If you want to reproduce them:\r\n\r\nCreate a vitepress site with a custom theme and Layout.vue file\r\nAdd the line `import VPNavBarSearch from 'vitepress/dist/client/theme-default/components/VPNavBarSearch.vue`\r\n\r\n```\r\nnode_modules/vitepress/dist/client/theme-default/components/VPAlgoliaSearchBox.vue:6:25 - error TS7016: Could not find a declaration file for module '../composables/data'. 'C:/Projects/bootstrap-vue-next/apps/docs/node_modules/vitepress/dist/client/theme-default/composables/data.js' implicitly has an 'any' type.\r\n\r\n6 import { useData } from '../composables/data'\r\n ~~~~~~~~~~~~~~~~~~~~~\r\n\r\nnode_modules/vitepress/dist/client/theme-default/components/VPLocalSearchBox.vue:2:30 - error TS2307: Cannot find module '@localSearchIndex' or its corresponding type declarations.\r\n\r\n2 import localSearchIndex from '@localSearchIndex'\r\n ~~~~~~~~~~~~~~~~~~~\r\n\r\nnode_modules/vitepress/dist/client/theme-default/components/VPLocalSearchBox.vue:13:18 - error TS7016: Could not find a declaration file for module 'mark.js/src/vanilla.js'. 'C:/Projects/bootstrap-vue-next/node_modules/.pnpm/mark.js@8.11.1/node_modules/mark.js/src/vanilla.js' implicitly has an 'any' type.\r\n Try `npm i --save-dev @types/mark.js` if it exists or add a new declaration (.d.ts) file containing `declare module 'mark.js/src/vanilla.js';`\r\n\r\n13 import Mark from 'mark.js/src/vanilla.js'\r\n ~~~~~~~~~~~~~~~~~~~~~~~~\r\n\r\nnode_modules/vitepress/dist/client/theme-default/components/VPLocalSearchBox.vue:30:28 - error TS7016: Could not find a declaration file for module '../../app/utils'. 'C:/Projects/bootstrap-vue-next/apps/docs/node_modules/vitepress/dist/client/app/utils.js' implicitly has an 'any' type.\r\n\r\n30 import { pathToFile } from '../../app/utils'\r\n ~~~~~~~~~~~~~~~~~\r\n\r\nnode_modules/vitepress/dist/client/theme-default/components/VPLocalSearchBox.vue:31:30 - error TS7016: Could not find a declaration file for module '../../shared'. 'C:/Projects/bootstrap-vue-next/apps/docs/node_modules/vitepress/dist/client/shared.js' implicitly has an 'any' type.\r\n\r\n31 import { escapeRegExp } from '../../shared'\r\n ~~~~~~~~~~~~~~\r\n\r\nnode_modules/vitepress/dist/client/theme-default/components/VPLocalSearchBox.vue:32:25 - error TS7016: Could not find a declaration file for module '../composables/data'. 'C:/Projects/bootstrap-vue-next/apps/docs/node_modules/vitepress/dist/client/theme-default/composables/data.js' implicitly has an 'any' type.\r\n\r\n32 import { useData } from '../composables/data'\r\n ~~~~~~~~~~~~~~~~~~~~~\r\n\r\nnode_modules/vitepress/dist/client/theme-default/components/VPLocalSearchBox.vue:33:26 - error TS7016: Could not find a declaration file for module '../support/lru'. 'C:/Projects/bootstrap-vue-next/apps/docs/node_modules/vitepress/dist/client/theme-default/support/lru.js' implicitly has an 'any' type.\r\n\r\n33 import { LRUCache } from '../support/lru'\r\n ~~~~~~~~~~~~~~~~\r\n\r\nnode_modules/vitepress/dist/client/theme-default/components/VPLocalSearchBox.vue:34:39 - error TS7016: Could not find a declaration file for module '../support/translation'. 'C:/Projects/bootstrap-vue-next/apps/docs/node_modules/vitepress/dist/client/theme-default/support/translation.js' implicitly has an 'any' type.\r\n\r\n34 import { createSearchTranslate } from '../support/translation'\r\n ~~~~~~~~~~~~~~~~~~~~~~~~\r\n\r\nnode_modules/vitepress/dist/client/theme-default/components/VPLocalSearchBox.vue:48:17 - error TS2339: Property 'hot' does not exist on type 'ImportMeta'.\r\n\r\n48 if (import.meta.hot) {\r\n ~~~\r\n\r\nnode_modules/vitepress/dist/client/theme-default/components/VPLocalSearchBox.vue:49:15 - error TS2339: Property 'hot' does not exist on type 'ImportMeta'.\r\n\r\n49 import.meta.hot.accept('/@localSearchIndex', (m) => {\r\n ~~~\r\n\r\nnode_modules/vitepress/dist/client/theme-default/components/VPLocalSearchBox.vue:49:49 - error TS7006: Parameter 'm' implicitly has an 'any' type.\r\n\r\n49 import.meta.hot.accept('/@localSearchIndex', (m) => {\r\n ~\r\n\r\nnode_modules/vitepress/dist/client/theme-default/components/VPNavBarSearch.vue:10:35 - error TS7016: Could not find a declaration file for module '../../shared'. 'C:/Projects/bootstrap-vue-next/apps/docs/node_modules/vitepress/dist/client/shared.js' implicitly has an 'any' type.\r\n\r\n10 import type { DefaultTheme } from '../../shared'\r\n ~~~~~~~~~~~~~~\r\n\r\nnode_modules/vitepress/dist/client/theme-default/components/VPNavBarSearch.vue:11:25 - error TS7016: Could not find a declaration file for module '../composables/data'. 'C:/Projects/bootstrap-vue-next/apps/docs/node_modules/vitepress/dist/client/theme-default/composables/data.js' implicitly has an 'any' type.\r\n\r\n11 import { useData } from '../composables/data'\r\n ~~~~~~~~~~~~~~~~~~~~~\r\n\r\nnode_modules/vitepress/dist/client/theme-default/components/VPNavBarSearch.vue:14:26 - error TS2304: Cannot find name '__VP_LOCAL_SEARCH__'.\r\n\r\n14 const VPLocalSearchBox = __VP_LOCAL_SEARCH__\r\n ~~~~~~~~~~~~~~~~~~~\r\n\r\nnode_modules/vitepress/dist/client/theme-default/components/VPNavBarSearch.vue:18:28 - error TS2304: Cannot find name '__ALGOLIA__'. \r\n\r\n18 const VPAlgoliaSearchBox = __ALGOLIA__\r\n ~~~~~~~~~~~\r\n\r\nnode_modules/vitepress/dist/client/theme-default/components/VPNavBarSearch.vue:48:8 - error TS2304: Cannot find name '__ALGOLIA__'. \r\n\r\n48 if (!__ALGOLIA__) {\r\n ~~~~~~~~~~~\r\n\r\nnode_modules/vitepress/dist/client/theme-default/components/VPNavBarSearch.vue:113:5 - error TS2304: Cannot find name '__VP_LOCAL_SEARCH__'.\r\n\r\n113 if (__VP_LOCAL_SEARCH__) {\r\n ~~~~~~~~~~~~~~~~~~~\r\n\r\nnode_modules/vitepress/dist/client/theme-default/components/VPNavBarSearch.vue:129:18 - error TS2304: Cannot find name '__ALGOLIA__'. \r\n\r\n129 const provider = __ALGOLIA__ ? 'algolia' : __VP_LOCAL_SEARCH__ ? 'local' : ''\r\n ~~~~~~~~~~~\r\n\r\nnode_modules/vitepress/dist/client/theme-default/components/VPNavBarSearch.vue:129:44 - error TS2304: Cannot find name '__VP_LOCAL_SEARCH__'.\r\n\r\n129 const provider = __ALGOLIA__ ? 'algolia' : __VP_LOCAL_SEARCH__ ? 'local' : ''\r\n ~~~~~~~~~~~~~~~~~~~\r\n\r\nnode_modules/vitepress/dist/client/theme-default/components/VPNavBarSearchButton.vue:3:39 - error TS7016: Could not find a declaration file for module '../support/translation'. 'C:/Projects/bootstrap-vue-next/apps/docs/node_modules/vitepress/dist/client/theme-default/support/translation.js' implicitly has an 'any' type.\r\n\r\n3 import { createSearchTranslate } from '../support/translation'\r\n\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.",[],4476,"Enable use of search components in custom layouts","2025-01-17T04:43:47Z","https://github.com/vuejs/vitepress/issues/4476",0.7235069,{"description":3111,"labels":3112,"number":3113,"owner":3033,"repository":3034,"state":3053,"title":3114,"updated_at":3115,"url":3116,"score":3117},"### Is your feature request related to a problem? Please describe.\n\nWe're using Custom Elements to encapsulate styles from our design system, so it'd be great to be able to tell Vitepress to ignore those tags.\r\n\r\nSuper lightweight example:\r\n\r\n```js\r\nclass ButtonExample extends HTMLElement {\r\n connectedCallback() {\r\n const designSystemCSS = '\u003Clink rel=\"stylesheet\" type=\"text/css\" href=\"designSystemURL\" />'\r\n const target = `\u003Cdiv id=\"app\">\u003C/div>`\r\n this.shadow = this.attachShadow({ mode: 'open' })\r\n this.shadow.innerHTML = designSystemCSS + target\r\n createApp(App) // App defined elsewhere ofc\r\n .mount(this.shadow.querySelector('#app'))\r\n }\r\n}\r\n```\n\n### Describe the solution you'd like\n\nProbably just being able to set `compilerOptions.isCustomElement` somewhere would be good enough?\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.",[],735,"Custom element support","2023-01-21T14:34:18Z","https://github.com/vuejs/vitepress/issues/735",0.72443956,["Reactive",3119],{},["Set"],["ShallowReactive",3122],{"$fTRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"$fTn3WWI7wVivNlq74GP7BPtZIHxewSlZzpkfpw-Hqvv4":-1},"/vuejs/vitepress/1937"]