Skip to content

Commit 6e93e6d

Browse files
author
狼叔
committed
add doc for git pages deploy
1 parent b732a34 commit 6e93e6d

File tree

4 files changed

+94
-0
lines changed

4 files changed

+94
-0
lines changed

.gitignore

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Logs
2+
logs
3+
*.log
4+
5+
# Runtime data
6+
pids
7+
*.pid
8+
*.seed
9+
10+
# Directory for instrumented libs generated by jscoverage/JSCover
11+
lib-cov
12+
13+
# Coverage directory used by tools like istanbul
14+
coverage
15+
16+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
17+
.grunt
18+
19+
# Compiled binary addons (http://nodejs.org/api/addons.html)
20+
build/Release
21+
22+
# Dependency directory
23+
# Commenting this out is preferred by some people, see
24+
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git-
25+
node_modules
26+
27+
# Users Environment Variables
28+
.lock-wscript
29+
.vscode/
30+
preview/
31+
package-lock.json

generate.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
cp -rf media preview/
2+
./node_modules/.bin/i5ting_toc README.md

gulpfile.js

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
var gulp = require('gulp');
2+
var gp_deploy = require('gulp-gh-pages');
3+
var open = require("gulp-open");
4+
var rename = require("gulp-rename");
5+
require('shelljs/global');
6+
7+
var options = {}
8+
gulp.task('deploy', function () {
9+
return gulp.src('./preview/**/*')
10+
.pipe(gp_deploy(options));
11+
});
12+
13+
gulp.task('rename',function () {
14+
if (exec('cp ./preview/README.html ./preview/index.html').code !== 0) {
15+
echo('Error: rename exec failed');
16+
exit(1);
17+
}
18+
});
19+
20+
gulp.task('generate',function () {
21+
// Run external tool synchronously
22+
if (exec('sh ./generate.sh').code !== 0) {
23+
echo('Error: generate.sh exec failed');
24+
exit(1);
25+
}
26+
});
27+
28+
gulp.task('show',['generate'] ,function () {
29+
console.log('show');
30+
});
31+
32+
gulp.task('default',['generate', 'rename', 'deploy'] ,function () {
33+
console.log('default');
34+
});

package.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"name": "How-to-learn-node-correctly",
3+
"version": "1.0.0",
4+
"description": "node.js tutorial ===================",
5+
"main": "",
6+
"scripts": {
7+
"test": "echo \"Error: no test specified\" && exit 1"
8+
},
9+
"repository": {
10+
"type": "git",
11+
"url": "https://github.com/i5ting/node-debug-tutorial.git"
12+
},
13+
"author": "",
14+
"license": "ISC",
15+
"bugs": {
16+
"url": "https://github.com/i5ting/node-debug-tutorial/issues"
17+
},
18+
"homepage": "https://github.com/i5ting/node-debug-tutorial",
19+
"dependencies": {
20+
"gulp": "^3.8.10",
21+
"gulp-gh-pages": "^0.4.0",
22+
"gulp-open": "^0.3.1",
23+
"gulp-rename": "^1.2.0",
24+
"i5ting_toc": "^1.1.5",
25+
"shelljs": "^0.3.0"
26+
}
27+
}

0 commit comments

Comments
 (0)