Skip to content

Commit

Permalink
fix: failed at first time
Browse files Browse the repository at this point in the history
  • Loading branch information
zuofenghua committed Nov 20, 2020
1 parent cba6080 commit 3b13e41
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 8 deletions.
20 changes: 16 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,28 @@ Inspired by [dumi](https://github.com/umijs/dumi).
- Support `demo` in \*.md file.
- Suppout locale suffix \*.md (like `index.zh-CN.md`).

## Cli
## Usage

[vitepress-dg-cli](https://github.com/dewfall123/vitepress-dg-cli)
### Using it with cli

We recommend using it with [cli](https://github.com/dewfall123/create-vlib.git)

```
yarn create vlib
```
yarn add vitepress-dg-cli -g

vitepress-dg-cli my-project
or

### Using it alone

Then you can use it like `vitepress`

```
yarn global add vitepress-dg
```

###

## License

[MIT](LICENSE)
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vitepress-dg",
"version": "0.8.0",
"version": "0.8.1",
"description": "",
"main": "dist/node/index.js",
"typings": "types/index.d.ts",
Expand Down
6 changes: 3 additions & 3 deletions src/node/genTemporary.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const DefaultSrcIncludes = ['src']
// generate a .temp dir
export async function genTemporary(options: ServerConfig = {}) {
const root = options.root!
const config = await resolveConfig(root)
const config = await resolveConfig(join(root, '..'))
const userConfig = config.userConfig
const langToPathMapping = getLangToPathMapping(
userConfig.locales ?? userConfig.themeConfig?.locales,
Expand Down Expand Up @@ -47,7 +47,7 @@ async function copyDocs(
})
files.forEach((file) => {
const descFile = join(root, tolocalePath(langToPathMapping, file))
console.log(file + ' -> ' + descFile)
// console.log(file + ' -> ' + descFile)
fsExtra.copy(join(docsPath, file), descFile)
})
}
Expand Down Expand Up @@ -86,7 +86,7 @@ async function copySrc(
}
const destFile = join(root, tolocalePath(langToPathMapping, destPath))

console.log(file + ' -> ' + destFile)
// console.log(file + ' -> ' + destFile)

await fsExtra.ensureFile(destFile)
await fsExtra.writeFile(destFile, matter.stringify(content, frontmatter))
Expand Down

0 comments on commit 3b13e41

Please sign in to comment.