I'm building a site with Jekyll and using Gulp to manage the assets. Since I'm using Gulp to manage my assets, I would like Jekyll to ignore ./assets in the conversion process and to leave ./_site/assets/ alone when building the rest of the site.
I've configured the _config.yml with
exclude: [assets] # Exclude assets/ from the conversion
keep: [assets] # Don't delete _site/assets when building the site
My gulpfile.js is:
var gulp = require('gulp');
var sass = require('gulp-ruby-sass');
gulp.task('sass', function() {
return sass('assets/stylesheets/main.scss')
.on('error', sass.logError)
.pipe(gulp.dest('_site/assets/'));
});
gulp.task('default', function() {
gulp.start('sass');
});
I then run:
gulp
jekyll build
When I run gulp
, the ./_sites/assets/ directory is created as expected, but when I run jekyll build
./_site/assets/ is deleted. What configuration am I missing?
As was noted before keep_files directive is correct, instead of just keep. Following information from Jekyll's site http://jekyllrb.com/docs/configuration/
I decided to check this by doing things from scratch step by step part that I appended to default jekyll's _config.yml file looks like this
wolf@sloth:~/blogs$ jekyll new dummy-blog New jekyll site installed in /home/wolf/blogs/dummy-blog. wolf@sloth:~/blogs$ cd dummy-blog/ wolf@sloth:~/blogs/dummy-blog$