docs: fix build errors

This commit is contained in:
DIYgod 2022-01-22 14:31:53 +00:00
parent 953d2b9dc4
commit b4ec4af7ad
No known key found for this signature in database
GPG Key ID: D159328F47A80DCA
1 changed files with 3 additions and 5 deletions

View File

@ -1,4 +1,4 @@
const { pinyin } = require('@napi-rs/pinyin');
const { pinyin, PINYIN_STYLE } = require('@napi-rs/pinyin');
const { slugify: _slugify } = require('@vuepress/shared-utils');
module.exports = {
@ -42,12 +42,10 @@ module.exports = {
slugify: function (s) {
return _slugify(
pinyin(s, {
style: pinyin.STYLE_NORMAL,
style: PINYIN_STYLE.Plain,
heteronym: true,
segment: true,
})
.map((item) => item[0])
.join('-')
}).join('-')
);
},
level: 2,