Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use Jekyll with Gulp

Tags:

gulp

jekyll

I read about Gulp and was quite taken by the philosophy. I want to try it out for myself but I am running into a little problem. I am used to using Jekyll with Grunt and I have no idea how to get Jekyll to play nice with Gulp.

I've come across this article which suggests there is no need for a Jekyll plugin when using Gulp. Unfortunately it doesn't really explain how to go about it and the example it links to doesn't help me much.

Is there anyone who knows how to go about this?

like image 398
Thijs Avatar asked Jan 22 '14 21:01

Thijs


1 Answers

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:

  1. Spawn Jekyll as a child process, most popular, as described by Sindre, here
  2. 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
  3. 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.

like image 106
Frank Lämmer Avatar answered Sep 21 '22 07:09

Frank Lämmer