From 07a296f6c8bafdb5caf22e8a8d06caef3c50a099 Mon Sep 17 00:00:00 2001 From: Evan You Date: Wed, 15 Mar 2023 09:24:28 +0800 Subject: [PATCH] docs: highlight vite, vue & markdown config --- docs/reference/site-config.md | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/docs/reference/site-config.md b/docs/reference/site-config.md index 2b091a3e..59f176a2 100644 --- a/docs/reference/site-config.md +++ b/docs/reference/site-config.md @@ -63,6 +63,20 @@ export default defineConfigWithTheme({ }) ``` +### Vite, Vue & Markdown Config + +- **Vite** + + You can configure the underlying Vite instance using the [vite](#vite) option in your VitePress config. No need to create a separate Vite config file. + +- **Vue** + + VitePress already includes the official Vue plugin for Vite ([@vitejs/plugin-vue](https://github.com/vitejs/vite-plugin-vue)). You can configure its options using the [vue](#vue) option in your VitePress config. + +- **Markdown** + + You can configure the underlying [Markdown-It](https://github.com/markdown-it/markdown-it) instance using the [markdown](#markdown) option in your VitePress config. + ## Site Metadata ### title @@ -322,7 +336,15 @@ Configure Markdown parser options. VitePress uses [Markdown-it](https://github.c export default { markdown: { theme: 'material-theme-palenight', - lineNumbers: true + lineNumbers: true, + + // adjust how header anchors are generated, + // useful for integrating with tools that use different conventions + anchors: { + slugify(str) { + return encodeURIComponent(str) + } + } } } ```