在Grails 3应用程序中引用Bootstrap的最佳方式

tom*_*son 10 grails twitter-bootstrap grails-3.0

我想将Twitter的Bootstrap引入我的Grails 3应用程序.最好的方法是什么?我既不想将源置于版本控制之下,也不想引用远程CDN.

"org.grails:grails-bootstrap:3.0.1"在我的库中添加作为编译依赖关系会build.gradle拉下相关的JAR,但是如何将其插入到我的应用程序中以最终能够从我的视图/ GSP中引用Bootstrap类?

bor*_*aas 7

Webjars为我工作,我使用了我application.js和我的webjars链接application.css,但链接并不总是很好定义(参见typeahead示例)

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
Run Code Online (Sandbox Code Playgroud)

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
*/
Run Code Online (Sandbox Code Playgroud)