From 2dec78812399e30305ee70fc1ff4499717b69074 Mon Sep 17 00:00:00 2001 From: Tony Date: Sun, 13 Feb 2022 04:19:36 -0800 Subject: [PATCH] docs: fix slug pinyin (#9084) docs: fix slug pinyin --- .eslintignore | 1 + docs/.vuepress/config.js | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.eslintignore b/.eslintignore index 6e0ff5eafd4963..5b176d4301179c 100644 --- a/.eslintignore +++ b/.eslintignore @@ -2,3 +2,4 @@ coverage .vscode docker-compose.yml !/.github +!/docs/.vuepress diff --git a/docs/.vuepress/config.js b/docs/.vuepress/config.js index 7c211b729bf3f0..15c031e7661b24 100644 --- a/docs/.vuepress/config.js +++ b/docs/.vuepress/config.js @@ -39,13 +39,15 @@ module.exports = { }, extendMarkdown: (md) => { md.use(require('../.format/md/hierarchySlug'), { - slugify: function (s) { + slugify(s) { return _slugify( pinyin(s, { style: PINYIN_STYLE.Plain, heteronym: true, segment: true, - }).join('-') + }) + .map((item) => item[0]) + .join('-') ); }, level: 2,