How to use Twitter Bootstrap 2 with play framework 2.x

前端 未结 8 1438
感动是毒
感动是毒 2020-12-04 08:11

I know that current Play! distribution has a helper for Bootstrap 1.4. What should I do if I want to use the current version of Bootstrap?

8条回答
  •  被撕碎了的回忆
    2020-12-04 08:41

    I had to do a couple things, including using the latest version of Play 2.0 due to some issues the released version had with compiling the less files used by bootstrap. Follow the instructions here https://github.com/playframework/Play20/wiki/BuildingFromSource to build from source. Then I placed all of the bootstrap less files in the "app/assets/stylesheets/" directory of your application. Play should only compile "bootstrap.less" so you need to add the following to "project/Build.scala":

    val main = PlayProject(appName, appVersion, appDependencies, mainLang = JAVA).settings(
      lessEntryPoints <<= baseDirectory(_/"app"/"assets"/"stylesheets" ** "bootstrap.less")
    )
    

    If you are using any of the bootstrap javascript plugins you'll need to add them to "public/javascripts" and include them in your HTML.

提交回复
热议问题