Skip to content

Commit

Permalink
docs: fix slug pinyin (DIYgod#9084)
Browse files Browse the repository at this point in the history
docs: fix slug pinyin
  • Loading branch information
Tony authored Feb 13, 2022
1 parent ccd4445 commit 2dec788
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ coverage
.vscode
docker-compose.yml
!/.github
!/docs/.vuepress
6 changes: 4 additions & 2 deletions docs/.vuepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 2dec788

Please sign in to comment.