` to be served at `/blog/` and `\u003CArticle />` to be served at inner routes\r\n3. Use custom layout component in `.vitepress/theme/index.js`\r\n```js\r\nexport default {\r\n ...DefaultTheme,\r\n Layout,\r\n};\r\n```\r\n3. Define routing logic in `Layout.vue` component\r\n```js\r\n\u003Ctemplate>\r\n \u003Cdiv>\r\n \u003CBlog v-if=\"isIndex\" />\r\n \u003CArticle v-else />\r\n \u003C/div>\r\n\u003C/template>\r\n\r\n\u003Cscript setup lang=\"ts\">\r\nimport { computed } from 'vue';\r\nimport { useRoute } from 'vitepress';\r\nimport Blog from './Blog.vue';\r\nimport Article from './Article.vue';\r\n\r\nconst route = useRoute();\r\nconst isIndex = computed(() => {\r\n return route.path.replace(/index.html$/, '') === '/';\r\n});\r\n\u003C/script>\r\n\r\n```\r\n\r\n### Expected behavior\r\n\r\nI expect that\r\n1. Blog component is served at `/blog/`\r\n2. Article component is served at `/blog/**/*` routes\r\n3. No `Hydration completed but contains mismatches.` error in the console\r\n4. No blinking screen that happens because the page is rendered as Article in SSR and then transformed into Blog during hydration\r\n\r\n### System Info\r\n\r\n```shell\r\nSystem:\r\n OS: macOS 11.6\r\n CPU: (8) x64 Intel(R) Core(TM) i5-1038NG7 CPU @ 2.00GHz\r\n Memory: 176.77 MB / 16.00 GB\r\n Shell: 5.8 - /bin/zsh\r\n Binaries:\r\n Node: 16.1.0 - ~/.nvm/versions/node/v16.1.0/bin/node\r\n Yarn: 1.22.10 - /usr/local/bin/yarn\r\n npm: 7.17.0 - ~/.nvm/versions/node/v16.1.0/bin/npm\r\n Browsers:\r\n Brave Browser: 92.1.28.106\r\n Chrome: 96.0.4664.45\r\n Firefox: 90.0.2\r\n Safari: 15.0\r\n npmPackages:\r\n vitepress: ^0.20.1 => 0.20.1\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] Follow our [Code of Conduct](https://vuejs.org/coc)\r\n- [X] Read the [docs](https://vitepress.vuejs.org/).\r\n- [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.",[],446,"route.path doesn't work correctly with base option","2023-01-21T14:35:45Z","https://github.com/vuejs/vitepress/issues/446",0.65744454,{"description":2908,"labels":2909,"number":2911,"owner":2871,"repository":2872,"state":2894,"title":2912,"updated_at":2913,"url":2914,"score":2915},"**Describe the bug**\r\n\r\nSee https://github.com/songololo/vitepress-debug for reproduction of this issue:\r\n\r\nRun a dev server: `yarn docs:dev`.\r\n\r\nNote that the base-path `/my-base-path/` is set in the config at `.vitepress/config.js`.\r\n\r\nThe base path works for root files, i.e. `index.md` is served from `/my-base-path/`.\r\n\r\nHowever, the base path is missing for nested files, i.e. `content/index.md` is served from `/content/` and `content/hello.md` is served from `/content/hello.html`.\r\n\r\nThis doesn't break things in development mode because the links are also missing the base path.\r\n\r\nHowever, it breaks things in production because the links are missing the base path.\r\n\r\n**System Info**\r\n- vitepress 0.12.2\r\n- vite/2.0.4\r\n- darwin-x64\r\n- node-v15.8.0\r\n\r\nThis happens for both my local system and for a github actions build.",[2910],{"name":2882,"color":2883},252,"Base paths (and links) not generating correctly for nested pages.","2023-01-21T16:20:10Z","https://github.com/vuejs/vitepress/issues/252",0.6594783,{"description":2917,"labels":2918,"number":2919,"owner":2871,"repository":2872,"state":2894,"title":2920,"updated_at":2921,"url":2922,"score":2923},"In Vitepress (vuejs/vitepress), the page HTML base path (`site.base`) and the static assets base path (`vite config.base`, equivalent to `publicPath` in webpack) are not handled separately. This causes issues when deploying the HTML and CDN separately (with the HTML being served from a dedicated domain and the CDN deployed on a general CDN service). The built pages cannot navigate correctly or the static assets fail to load properly.\r\n\r\nThe current code handling both `site.base` and `vite.config.base` consistently can be found at the following link:\r\n\r\nhttps://github.com/vuejs/vitepress/blob/b16340acbd3c60fee023daadb0ec5a0292060a1e/src/node/build/bundle.ts#L60\r\n\r\nIt would be beneficial to separate the handling of these two base paths to better support different deployment scenarios.",[],2144," Separate handling of page HTML base path and static assets base path in Vitepress","2023-04-04T00:03:58Z","https://github.com/vuejs/vitepress/issues/2144",0.6823907,{"description":2925,"labels":2926,"number":2927,"owner":2871,"repository":2872,"state":2894,"title":2928,"updated_at":2929,"url":2930,"score":2931},"### Describe the bug\n\nI want to use `VitePress` to build a blog, I want to find current post base on route, so i have below code:\r\n```\r\n\tfunction findCurrentIndex() {\r\n\t\t\r\n\t\tconst result = posts.findIndex((p) => p.url.includes(route.path))\r\n\t\tif (result === -1) console.error(`blog post missing: ${route.path}`)\r\n\t\treturn result\r\n\t}\r\n\r\n```\r\nthis works fine, when we do not enable rewrites or set `base` configuration, because url of post comes from `createContentLoader` do not add `base` or prefix, so I wrap the url with `withBase` in many places, could anyone explain why `createContentLoader ` not return the 'correct' url base on site configuration or rewrites rules? \r\nI add `withBase` inside loader as well, but It doesn't work\r\n```\r\nexport default createContentLoader(pattern, {\r\n\texcerpt: '\u003C!--more-->',\r\n\ttransform(raw): Post[] {\r\n\t\treturn raw\r\n\t\t\t.map(({ url, frontmatter, excerpt }) => ({\r\n\t\t\t\ttitle: frontmatter.title,\r\n\t\t\t\tcategories: frontmatter?.categories ?? [],\r\n\t\t\t\tdescription: excerpt,\r\n\t\t\t\ttags: frontmatter.tags ?? [],\r\n\t\t\t\turl: withBase(url), // in here will got error message: does not provide an export named 'withBase'\r\n\t\t\t\texcerpt,\r\n\t\t\t\tdate: formatDate(frontmatter.date),\r\n\t\t\t}))\r\n\t\t\t.sort((a, b) => b.date.time - a.date.time)\r\n\t},\r\n})\r\n```\n\n### Reproduction\n\nas describe\n\n### Expected behavior\n\ncreateContentLoader return correct url\n\n### System Info\n\n```Text\nSystem:\r\n OS: Windows 10 10.0.22621\r\n CPU: (4) x64 Intel(R) Core(TM) i5-7500 CPU @ 3.40GHz\r\n Memory: 19.90 GB / 31.96 GB\r\n Binaries:\r\n Node: 18.17.1 - C:\\Program Files\\nodejs\\node.EXE\r\n npm: 9.6.7 - C:\\Program Files\\nodejs\\npm.CMD\r\n pnpm: 8.7.4 - ~\\AppData\\Roaming\\npm\\pnpm.CMD\r\n Browsers:\r\n Edge: Chromium (117.0.2045.60)\r\n Internet Explorer: 11.0.22621.1\r\n npmPackages:\r\n vitepress: 1.0.0-rc.20 => 1.0.0-rc.20\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.",[],3063,"createContentLoader do not return correct url of post","2023-10-24T00:04:13Z","https://github.com/vuejs/vitepress/issues/3063",0.68707013,{"description":2933,"labels":2934,"number":2938,"owner":2871,"repository":2872,"state":2894,"title":2939,"updated_at":2940,"url":2941,"score":2942},"### Describe the bug\n\nI was deploying my project with GitHub Pages as indicated in the documentation using a `deploy.sh` file and everything works correctly until I open my web from the GH pages link.\r\n\r\nHere a preview https://dev.adonys.me/vitepress/\r\n\r\nI am using a custom domain with CNAME which redirects me from https://dev.adonys.me to https://adonyssantos.github.io.\n\n### Reproduction\n\nThe only thing I did was to deploy the page with GitHub Page using a `deploy.sh` file as indicated in the official documentation.\n\n### Expected behavior\n\nI expected that when I enter my site from https://dev.adonys.me/vitepress to see my site correctly (no duplicate), but I enter and the same page is repeated 2 times.\n\n### System Info\n\n```shell\nMy vitepress config:\r\n\r\nexport default {\r\n base: '/vitepress/',\r\n title: 'Adonys Santos',\r\n description: 'Learning Vitepress.',\r\n};\n```\n\n\n### Additional context\n\nhttps://dev.adonys.me/vitepress/\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.",[2935],{"name":2936,"color":2937},"need more info","bdbefc",845,"bug: Duplicate view when deployed with GitHub Pages","2023-01-21T14:30:24Z","https://github.com/vuejs/vitepress/issues/845",0.6926531,{"description":2944,"labels":2945,"number":2949,"owner":2871,"repository":2872,"state":2894,"title":2950,"updated_at":2951,"url":2952,"score":2953},"### Is your feature request related to a problem? Please describe.\r\n\r\nWhen reading the docs of VitePress from beginning to end, I found that `base` is mentioned the first time in https://vitepress.vuejs.org/guide/deploying.html#github-pages , I didn't know what it was for until I found https://vitepress.vuejs.org/config/app-configs.html#base .\r\n\r\n### Describe the solution you'd like\r\n\r\nIt would be nice to briefly describe what `base` does in the [Deploying](https://vitepress.vuejs.org/guide/deploying.html) section, or at least add a link to the [App Configs](https://vitepress.vuejs.org/config/app-configs.html#base) page.\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.vuejs.org).\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.",[2946],{"name":2947,"color":2948},"docs","0075ca",789,"Explanation of `base`","2023-01-21T14:32:36Z","https://github.com/vuejs/vitepress/issues/789",0.69284034,{"description":2955,"labels":2956,"number":2958,"owner":2871,"repository":2872,"state":2894,"title":2959,"updated_at":2960,"url":2961,"score":2962},"### Describe the bug\n\nIf you configure the base config property, it somewhat works on dev. The way it appears to work is that it navigates to the requested page, but proceeds to redirect you to the true page directly after. \r\n\r\nIf this is how it works on dev, it isn't really a foolproof solution. \r\n\r\nThe issue mainly is that on a built copy, this method doesn't work at all. Even if you have a base config property, it doesn't redirect you. \r\n\r\nKeep in mind that I'm using these links in _layout.vue_ which may be different in an md file. \n\n### Reproduction\n\nCreate an app, \r\nconfigure the base\r\nGo to layout\r\nCreate some links, say, to /about\r\nTry to navigate on dev, seemingly goes to /about then redirects to /${base}/about\r\n- works\r\nBuild the project\r\nPreview\r\nTry to navigate to /about\r\n- does not work -> goes directly to /about and not /`${base}/about\n\n### Expected behavior\n\nIt would be nice if Vitepress was smart enough to compile all the links with the base property. Like I've said, it seems that the method is redirection, but perhaps I'm confused. \n\n### System Info\n\n```sh\nSystem:\r\n OS: Linux 6.2 Pop!_OS 22.04 LTS\r\n CPU: (12) x64 AMD Ryzen 5 3600X 6-Core Processor\r\n Memory: 7.46 GB / 15.53 GB\r\n Container: Yes\r\n Shell: 5.1.16 - /bin/bash\r\n Binaries:\r\n Node: 18.16.0 - /run/user/1000/fnm_multishells/11424_1683296095333/bin/node\r\n npm: 9.5.1 - /run/user/1000/fnm_multishells/11424_1683296095333/bin/npm\r\n Browsers:\r\n Firefox: 112.0.2\r\n npmPackages:\r\n vitepress: 1.0.0-alpha.75 => 1.0.0-alpha.75\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.",[2957],{"name":2947,"color":2948},2339,"Config 'base' option works on dev, but doesn't quite work on build","2023-06-03T00:03:55Z","https://github.com/vuejs/vitepress/issues/2339",0.69492847,["Reactive",2964],{},["Set"],["ShallowReactive",2967],{"$fTRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"$fP3KKNoBI2pLdtf0bvT_z8awb23k3tlZ7Tc5wy1Fm6EA":-1},"/vuejs/vitepress/587"]