Skip to content

Commit

Permalink
demos
Browse files Browse the repository at this point in the history
  • Loading branch information
lavrton committed Jun 30, 2018
1 parent af92d7c commit b95b130
Show file tree
Hide file tree
Showing 11 changed files with 1,089 additions and 2,253 deletions.
2 changes: 1 addition & 1 deletion deploy.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash

rm ./db.json
npm start
npm run build

echo "commit site changes"
git add .
Expand Down
19 changes: 6 additions & 13 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,28 +1,26 @@
var gulp = require('gulp'),
clean = require('gulp-clean'),
shell = require('gulp-shell'),
jsdoc = require('gulp-jsdoc3'),
webserver = require('gulp-webserver');
jsdoc = require('gulp-jsdoc3');

// steps
// 1. clean /public folder
// 2. generate new /public with hexo
// 3. replace /public/downloads with /source/downloads
// 4. generate api docs to /public

// 1
// 1 clean /public folder
gulp.task('clean-public', function() {
return gulp.src('public', { read: false }).pipe(clean());
});

// 2
// 2 generate new /public with hexo
gulp.task(
'generate-hexo',
['clean-public'],
shell.task(['node ./node_modules/hexo/bin/hexo generate'], { cwd: './' })
);

// 3
// 3 replace /public/downloads with /source/downloads
gulp.task('clean-public-downloads', ['generate-hexo'], function() {
return gulp.src('public/downloads', { read: false }).pipe(clean());
});
Expand All @@ -31,22 +29,17 @@ gulp.task('copy-source-download', ['clean-public-downloads'], function() {
return gulp.src('source/downloads/**').pipe(gulp.dest('public/downloads'));
});

// 4
// 4 generate api docs to /public
gulp.task('docs', function() {
var config = require('./jsdoc.json');
return gulp.src(['./konva.js', '../konva/README.md']).pipe(jsdoc(config));
});

gulp.task('server', function() {
gulp.src('public').pipe(webserver({}));
});

gulp.task('generate', [
'clean-public',
'generate-hexo',
'clean-public-downloads',
'copy-source-download',
'docs'
]);

gulp.task('default', ['generate', 'server']);
gulp.task('default', ['generate']);
Loading

0 comments on commit b95b130

Please sign in to comment.