Sinatra Zurb基金会5,Bower,罗盘,西纳特拉配置

Sinatra Zurb基金会5,Bower,罗盘,西纳特拉配置,sinatra,sass,zurb-foundation,compass-sass,Sinatra,Sass,Zurb Foundation,Compass Sass,我正在尝试使用找到的foundation cli将带有sass的Zurb foundation添加到我的sinatra应用程序中。我生成了一个基金项目,并得到了所有生成的文件。我注释掉了config.rb,这样我就可以通过app.rbiemvp.rb配置指南针了 我无法链接到bower_components目录中找到的实际资产。我可以像这样链接所有东西get'bower\u components/file'do。。。结束但我认为您可以使用compass根据配置自动使用文件。不过我不知道该怎么做

我正在尝试使用找到的foundation cli将带有sass的Zurb foundation添加到我的sinatra应用程序中。我生成了一个基金项目,并得到了所有生成的文件。我注释掉了
config.rb
,这样我就可以通过
app.rb
ie
mvp.rb
配置指南针了

我无法链接到bower_components目录中找到的实际资产。我可以像这样链接所有东西
get'bower\u components/file'do。。。结束
但我认为您可以使用compass根据配置自动使用文件。不过我不知道该怎么做

在我的haml视图中,我有指向当前未链接的脚本的链接,如
%script{src:'js/jquery.js'}

config.rb

# Require any additional compass plugins here.
add_import_path "bower_components/foundation/scss"

# Set this to the root of your project when deployed:
# http_path = "/"
# css_dir = "stylesheets"
# sass_dir = "scss"
# images_dir = "images"
# javascripts_dir = "javascripts"

# You can select your preferred output style here (can be overridden via the command line):
# output_style = :expanded or :nested or :compact or :compressed

# To enable relative paths to assets via compass helper functions. Uncomment:
# relative_assets = true

# To disable debugging comments that display the original location of your selectors. Uncomment:
# line_comments = false


# If you prefer the indented syntax, you might want to regenerate this
# project again passing --syntax sass, or you can uncomment this:
# preferred_syntax = :sass
# and then run:
# sass-convert -R --from scss --to sass sass scss && rm -rf sass && mv scss sass
应用程序目录

Gemfile         config.rb       public
Gemfile.lock        index.html      stylesheets
js          views                   bower.json      
mvp.rb      bower_components    
mvp.rb

  1#!/usr/bin/env ruby                                                                       
  2# -*- coding: utf-8 -*-                                                                   
  3require 'rubygems'
  4require 'bundler/setup'
  5require 'sinatra'
  6require 'haml'
  7require 'compass'
  8
  9configure do
 10  Compass.configuration do |config|
 11    config.project_path = File.dirname(__FILE__)
 12    config.sass_dir = File.join '/views/scss'
 13    config.images_dir = 'views', 'images'
 14    config.http_path = '/'
 15    config.http_images_path = '/images'
 16    config.http_stylesheets_path = '/stylesheets'
 17    config.javascripts_dir = "js"
 18  end
 19
 20  set :haml, { format: :html5 }
 21  set :scss, { style: :compact, debug_info: false }
 22end
 23
 24get '/stylesheets/:name.css' do |path|
 25  content_type "text/css", charset: "utf-8"
 26  scss :"scss/#{params[:name]}", Compass.sass_engine_options
 27end