簡體   English   中英

如何在bootstrap-sass gem上實現boostrap模板

[英]How to implement a boostrap template over bootstrap-sass gem

我有一個使用bootstrap-sass gem的ROR應用程序,我想將我購買的模板加載到該應用程序上並覆蓋常規的bootstrap。 該模板為我提供了以下文件...

- template (The Project template) 
- - bootstrap  (All Bootstrap files. We keep all of them in this folder to make updates easily)
- - css  (CSS files of the template)
- - - skins  (CSS skin files)
- - fonts (External font libraries)
- - - font-awesome
- - - fontello
- - images  (All the images of the template)
- - js  (Javascript files of the template)
- - less  (All the less files)
- - php  (PHP files of the template)
- - plugins  (All external libs. We keep all of them in this folder to make updates easily.)
- - videos  (All video files)

我在lib / assets文件中加載了這棵文件樹,但看不到如何訪問它們。 根據文檔,這應該訪問文件,但似乎不起作用。

<!-- Web Fonts -->
<link href='https://fonts.googleapis.com/css?family=Roboto:400,300,300italic,400italic,500,500italic,700,700italic' rel='stylesheet' type='text/css'>
<link href='https://fonts.googleapis.com/css?family=Raleway:700,400,300' rel='stylesheet' type='text/css'>
<link href='https://fonts.googleapis.com/css?family=Pacifico' rel='stylesheet' type='text/css'>
<link href='https://fonts.googleapis.com/css?family=PT+Serif' rel='stylesheet' type='text/css'>

<!-- Bootstrap core CSS -->
<link href="stylesheets/bootstrap.css" rel="stylesheet">

<!-- Font Awesome CSS -->
<link href="fonts/font-awesome/css/font-awesome.css" rel="stylesheet">

<!-- Fontello CSS -->
<link href="fonts/fontello/css/fontello.css" rel="stylesheet">

<!-- Plugins -->
<link href="plugins/magnific-popup/magnific-popup.css" rel="stylesheet">
<link href="plugins/rs-plugin/css/settings.css" rel="stylesheet">
<link href="stylesheets/animations.css" rel="stylesheet">
<link href="javascripts/plugins/owl-carousel/owl.carousel.css" rel="stylesheet">
<link href="plugins/owl-carousel/owl.transitions.css" rel="stylesheet">
<link href="plugins/hover/hover-min.css" rel="stylesheet">

<!-- the project core CSS file -->
<link href="stylesheets/style.css" rel="stylesheet" >

<!-- Color Scheme (In order to change the color scheme, replace the blue.css with the color scheme that you prefer)-->
<link href="css/skins/light_blue.css" rel="stylesheet">

<!-- Custom css -->
<link href="/stylesheets/custom.css" rel="stylesheet">

我似乎無法訪問任何文件。 我正在使用gem'bootstrap-sass','〜> 3.2.0'

我嘗試將文件導入到application.scss file

@import "bootstrap";
@import "custom";
@import "style";
@import "animate";
@import "animations";

我的日志中不斷顯示錯誤...

Started GET "/stylesheets/custom.css" for 10.0.2.2 at 2015-11-24 19:11:15 +0000

ActionController::RoutingError (No route matches [GET] "/stylesheets/custom.css"):,etc...

我不確定如何在開發或生產中訪問文件。

我建議您先閱讀資產管道文檔: http : //guides.rubyonrails.org/asset_pipeline.html

我注意到的一件事是您將文件添加到了:lib / assets,我建議您將它們放在vendor\\assets如下所示:

這是目錄的樣子,實際上我也有一些文件

然后,您需要像上述一樣將這些文件分別添加到Javascript(application.js)和Stylesheet(stylesheet.css.scss)清單中。

而且,您所擁有的幾個庫都可以作為寶石使用,它們通常使向項目中添加資產變得更加容易。 我知道貓頭鷹-胡蘿卜有寶石,字體也很棒。

希望有幫助!

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM