If you use Gulp and want to publish a static version of your site to Github pages, here’s a way to do it.
You’ll need these installed and required:
var del = require('del');
var run = require('gulp-run');
var ghPages = require('gulp-gh-pages');
Here’s the Gulp code, note that it references statify.php, which you can find here
Be sure to customize it with your github pages URL.
/*
deploying to github pages
statify is used to transform the site into static HTML in the dist directory
gh-pages is used to send result to github pages for this repo
*/
gulp.task('clean:static', function () {
return del([
'kirby/static/**/*'
]);
});
// After cleaning, call your normal build tasks whatever they are.
// Replace ('css', 'panel', etc)
gulp.task('static', ['clean:static','css','panel','js','images','video'], function(){
return run('php ./kirby/statify.php').exec();
})
gulp.task('deploy', ['static'], function(){
return gulp.src('./kirby/static/**/*')
.pipe(ghPages());
})
When you’re ready to deploy, just run
gulp deploy