diff --git a/packages/docs/docs/config/README.md b/packages/docs/docs/config/README.md index d448827930..61a2028e33 100644 --- a/packages/docs/docs/config/README.md +++ b/packages/docs/docs/config/README.md @@ -206,9 +206,9 @@ Whether to show line numbers to the left of each code blocks. ### markdown.slugify - Type: `Function` -- Default: [source](https://github.com/vuejs/vuepress/blob/master/lib/markdown/slugify.js) +- Default: [source](https://github.com/vuejs/vuepress/tree/master/packages/@vuepress/shared-utils/lib/slugify.js) -Function for transforming header texts into slugs. This affects the ids/links generated for header anchors, table of contents and sidebar links. +Function for transforming header texts into slugs. Changing this affects the ids/links generated for header anchors, table of contents and sidebar links. ### markdown.externalLinks diff --git a/packages/docs/docs/zh/config/README.md b/packages/docs/docs/zh/config/README.md index b10c1068f1..5c1082c683 100644 --- a/packages/docs/docs/zh/config/README.md +++ b/packages/docs/docs/zh/config/README.md @@ -197,6 +197,13 @@ VuePress provides a convenient way to add extra styles. you can create an `.vuep - [行号](../guide/markdown.md#行号) +### markdown.slugify + +- Type: `Function` +- Default: [source](https://github.com/vuejs/vuepress/tree/master/packages/@vuepress/shared-utils/lib/slugify.js) + +一个将标题文本转换为 slug 的函数。修改它会影响标题锚点、TOC、以及侧边栏链接生成的 id 和 链接。 + ### markdown.anchor - 类型: `Object`