Being late to the party, I'd like to ask:
Why you want to combine Jekyll with Gulp?
Jekyll already has some built in tasks, compiling SCSS to CSS for example. And Jekyll itself can also be extended with plugins, for things like minifying and prefixing. So: You might not need to combine two different technologies here at all.
One reason might be, that you want to publish to GitHub pages (extra plugins not supported). So that asset pipelining and Jekyll built will have to become two separated steps. In my case, I was already using auto-prefixer
and I didn't wanted to go back to use mixins
for that.
While researching and testing this, I found different methods for a Jekyll+Gulp-workflow:
- Spawn Jekyll as a child process, most popular, as described by Sindre,
here
- Run Jekyll serve and Gulp in parallel, there is no need to integrate one into the other, you can also have them running side by side to develop
- Call Jekyll from Gulp via a shell command,
.pipe(run('bundle exec jekyll build');
Source.
Most people are using Browsersync to serve the site locally then, instead of the builtin jekyll serve
method.