Skip to content

Commit 2bea54c

Browse files
committed
fix docs
1 parent 15fd712 commit 2bea54c

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

scripts/gulpfile.js

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict'
22
const webpack = require('webpack')
3-
3+
const through2 = require('through2')
44
const path = require('path')
55
const gulp = require('gulp')
66
const readline = require('readline')
@@ -67,6 +67,26 @@ function copyHtml () {
6767
fs.writeFileSync(path.join(cwd, `${toPath2}/index.html`), fs.readFileSync(path.join(cwd, 'site-dist/index.html')))
6868
})
6969
})
70+
const source = [
71+
'docs/vue/*.md',
72+
// '!components/vc-slider/**/*', // exclude vc-slider
73+
]
74+
gulp.src(source).pipe(through2.obj(function z (file, encoding, next) {
75+
const paths = file.path.split('/')
76+
const name = paths[paths.length - 1].split('.')[0]
77+
const toPaths = [
78+
'site-dist/docs',
79+
'site-dist/docs/vue',
80+
`site-dist/docs/vue/${name}`,
81+
`site-dist/docs/vue/${name}-cn`,
82+
]
83+
toPaths.forEach(toPath => {
84+
mkdirp(path.join(cwd, toPath), function () {
85+
fs.writeFileSync(path.join(cwd, `${toPath}/index.html`), fs.readFileSync(path.join(cwd, 'site-dist/index.html')))
86+
})
87+
})
88+
next()
89+
}))
7090
}
7191

7292
gulp.task('site-dist', (done) => {

0 commit comments

Comments
 (0)