sondr3 / generator-jekyllized

A Yeoman generator for Jekyll to rapidly build sites using Gulp
MIT License
326 stars 35 forks source link

How to add jquery and other js files #149

Closed sackwort closed 8 years ago

sackwort commented 8 years ago

I have added jquery and modernizr to my project by adding 'bower_components/jquery/dist/jquery.js', 'src/assets/javascript/modernizr-custom.js' to gulp.src in both assets.js and scripts.js.

So both files now look like this:

gulp.task('scripts', () => // NOTE: The order here is important since it's concatenated in order from // top to bottom, so you want vendor scripts etc on top gulp.src([ 'bower_components/jquery/dist/jquery.js', 'src/assets/javascript/modernizr-custom.js', 'src/assets/javascript/vendor.js', 'src/assets/javascript/main.js' ])

This seems to be working all right, but would you mind telling me whether or not this is the correct way to do this?

sondr3 commented 8 years ago

That looks about right, yeah, you should actually delete the scripts.js file as I've moved on to using it in assets.js instead. There's some info in the FAQ in the Readme here if you need more information :smiley:

sackwort commented 8 years ago

Thanks very much for your help.