diff --git a/packages/docs/.vitepress/config/shared.ts b/packages/docs/.vitepress/config/shared.ts index 17a194893..f12b71f5d 100644 --- a/packages/docs/.vitepress/config/shared.ts +++ b/packages/docs/.vitepress/config/shared.ts @@ -1,5 +1,9 @@ import { defineConfig, HeadConfig } from 'vitepress' import { zhSearch } from './zh' +import { + groupIconMdPlugin, + groupIconVitePlugin, +} from 'vitepress-plugin-group-icons' // TODO: // export const META_IMAGE = 'https://router.vuejs.org/social.png' @@ -60,6 +64,9 @@ export const sharedConfig = defineConfig({ anchor: { slugify, }, + config: md => { + md.use(groupIconMdPlugin) + }, }, head: [ @@ -161,4 +168,7 @@ export const sharedConfig = defineConfig({ placement: 'routervuejsorg', }, }, + vite: { + plugins: [groupIconVitePlugin()], + }, }) diff --git a/packages/docs/.vitepress/theme/index.ts b/packages/docs/.vitepress/theme/index.ts index c2797c6bf..81d8d20c1 100644 --- a/packages/docs/.vitepress/theme/index.ts +++ b/packages/docs/.vitepress/theme/index.ts @@ -9,6 +9,7 @@ import VueSchoolLink from './components/VueSchoolLink.vue' import VueMasteryLogoLink from './components/VueMasteryLogoLink.vue' import status from '../translation-status.json' import RuleKitLink from './components/RuleKitLink.vue' +import 'virtual:group-icons.css' const i18nLabels = { zh: '该翻译已同步到了 ${date} 的版本,其对应的 commit hash 是 ${hash}。', diff --git a/packages/docs/guide/advanced/lazy-loading.md b/packages/docs/guide/advanced/lazy-loading.md index 7cbb183fd..d1ca69d70 100644 --- a/packages/docs/guide/advanced/lazy-loading.md +++ b/packages/docs/guide/advanced/lazy-loading.md @@ -67,8 +67,7 @@ webpack will group any async module with the same chunk name into the same async In Vite you can define the chunks under the [`rollupOptions`](https://vite.dev/config/build-options.html#build-rollupoptions): -```js -// vite.config.js +```js [vite.config.js] export default defineConfig({ build: { rollupOptions: { diff --git a/packages/docs/guide/advanced/navigation-guards.md b/packages/docs/guide/advanced/navigation-guards.md index 271add59f..17a5f826c 100644 --- a/packages/docs/guide/advanced/navigation-guards.md +++ b/packages/docs/guide/advanced/navigation-guards.md @@ -140,8 +140,7 @@ Learn more about navigation failures on [its guide](./navigation-failures.md). Since Vue 3.3, it is possible to use `inject()` within navigation guards. This is useful for injecting global properties like the [pinia stores](https://pinia.vuejs.org). Anything that is provided with `app.provide()` is also accessible within `router.beforeEach()`, `router.beforeResolve()`, `router.afterEach()`: -```ts -// main.ts +```ts [main.ts] const app = createApp(App) app.provide('global', 'hello injections') diff --git a/packages/docs/guide/essentials/history-mode.md b/packages/docs/guide/essentials/history-mode.md index 0bbdba94c..641fb9797 100644 --- a/packages/docs/guide/essentials/history-mode.md +++ b/packages/docs/guide/essentials/history-mode.md @@ -128,7 +128,7 @@ For Node.js/Express, consider using [connect-history-api-fallback middleware](ht 1. Install [IIS UrlRewrite](https://www.iis.net/downloads/microsoft/url-rewrite) 2. Create a `web.config` file in the root directory of your site with the following: -```xml +```xml [web.config ~vscode-icons:file-type-xml~] @@ -167,7 +167,7 @@ rewrite { Add this to your `firebase.json`: -```json +```json [firebase.json ~vscode-icons:file-type-firebase~] { "hosting": { "public": "dist", @@ -185,7 +185,7 @@ Add this to your `firebase.json`: Create a `_redirects` file that is included with your deployed files: -``` +``` [_redirects ~vscode-icons:file-type-light-netlify~] /* /index.html 200 ``` @@ -197,7 +197,7 @@ You can read more about the syntax on [Netlify documentation](https://docs.netli Create a `vercel.json` file under the root directory of your project with the following: -```json +```json [vercel.json ~vscode-icons:file-type-light-vercel~] { "rewrites": [{ "source": "/:path*", "destination": "/index.html" }] } diff --git a/packages/docs/guide/essentials/named-views.md b/packages/docs/guide/essentials/named-views.md index 03ca222ec..ba5738849 100644 --- a/packages/docs/guide/essentials/named-views.md +++ b/packages/docs/guide/essentials/named-views.md @@ -61,8 +61,7 @@ It is possible to create complex layouts using named views with nested views. Wh The `