Skip to content

Commit

Permalink
fix: 修复suffix错误识别bug
Browse files Browse the repository at this point in the history
  • Loading branch information
zuofenghua committed Jan 16, 2021
1 parent 15dbb7d commit 111ed01
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
11 changes: 11 additions & 0 deletions docs/.vitepress/theme/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import DefaultTheme from 'vitepress/dist/client/theme-default'

export default {
...DefaultTheme,

enhanceApp({ app, router, siteData }) {
// app is the Vue 3 app instance from `createApp()`. router is VitePress'
// custom router. `siteData`` is a `ref`` of current site-level metadata.
console.log(111)
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vitepress-for-component",
"version": "0.11.4",
"version": "0.11.5",
"description": "dumi like documentation tool",
"main": "dist/node/index.js",
"typings": "types/index.d.ts",
Expand Down
3 changes: 3 additions & 0 deletions src/node/temporary/copy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,5 +107,8 @@ function tolocalePath(mapping: Record<string, string> | null, path: string) {
const lang = extname(fileName.slice(0, -ext.length))
// en/
const langPrefix = mapping[lang.slice(1)]
if (!(langPrefix in mapping)) {
return path
}
return `${langPrefix}${path.slice(0, -(ext + lang).length)}${ext}`
}

0 comments on commit 111ed01

Please sign in to comment.