Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Best way to reference Bootstrap in a Grails 3 app

I'm wanting to pull in Twitter's Bootstrap into my Grails 3 app. What's the best way to do this? I neither want to place the source under version control nor reference remote CDNs.

Adding "org.grails:grails-bootstrap:3.0.1" as a compilation dependency in my build.gradle pulls down the associated JAR, but how do I plumb this into my application to ultimately be able to reference Bootstrap classes from my views/GSPs?

like image 523
tomwadeson Avatar asked May 28 '15 13:05

tomwadeson


1 Answers

Webjars worked for me, I've used the webjars link in my application.js and in my application.css, but the links are not always well defined (see typeahead example)

application.js:

//= require jquery-2.1.3.js
//= require_tree .
//= require_self
//= require /webjars/bootstrap/3.3.5/js/bootstrap.min
//= require /webjars/bootstrap-tagsinput/0.5/bootstrap-tagsinput
//= require /webjars/typeaheadjs/0.11.1/typeahead.bundle.js

application.css:

/*
*= require main
*= require mobile
*= require_self
*= require /webjars/bootstrap/3.3.5/css/bootstrap-theme
*= require /webjars/bootstrap/3.3.5/css/bootstrap
*= require /webjars/bootstrap-tagsinput/0.5/bootstrap-tagsinput
*/
like image 79
boraas Avatar answered Sep 24 '22 09:09

boraas