1
votes

I've been trying multiple solutions to integrate bower assets in jekyll but none seem simple enough or future safe.

One interesting solution would be to add to sass_dir all gem assets dirs from any https://rails-assets.org gem (which converts any bower repo into a assets gem automatically) but I did not find docs that says it's possible. Or use bower and import the sass files. But without grunt.

The goal is to be able to @import sass from asset gems, push on gh-pages branch and let github deploy without any extra step.

1

1 Answers

0
votes

I ended up adding the bower packages directly to the _sass dir. No special config except your .bowerrc file should point to the _sass dir:

{
  "directory" : "_sass"
}

It's not ideal for big projects but in my case it fits perfectly my needs.

This solution is the simplest if you're directly pushing to gh-pages branch directly.

If you have a more complex setup and many bower packages, then I think I'd go for a custom build with 2 branches and a grunt based flow.

Then you can use sass load_paths as mentioned here https://github.com/jekyll/jekyll/issues/3366

sass:
    sass_dir:
        - _sass
        - bower_components