Created
June 15, 2011 14:57
-
-
Save airios/1027287 to your computer and use it in GitHub Desktop.
Setting up Compass with NestaCMS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# themes/theme-name/app.rb | |
require 'rubygems' # Can't leave < 1.9.2 hanging... | |
require 'compass' | |
require 'sinatra' | |
require 'haml' | |
module Nesta | |
class App | |
configure do | |
Compass.configuration do |config| | |
config.project_path = File.dirname(__FILE__) | |
config.sass_dir = 'views' | |
config.environment = :development | |
config.relative_assets = true | |
config.http_path = "/" | |
end | |
set :haml, { :format => :html5 } | |
set :sass, Compass.sass_engine_options | |
end | |
get '/css/:sheet.css' do | |
content_type 'text/css', :charset => 'utf-8' | |
cache sass(params[:sheet].to_sym) | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// themes/theme-name/views/layout.haml | |
<!DOCTYPE html> | |
%html(lang="en") | |
%head | |
%meta(charset="utf-8") | |
- if @description | |
%meta(name="description" content=@description) | |
- if @keywords | |
%meta(name="keywords" content=@keywords) | |
%title= @title | |
<!--[if ! lte IE 6]><!--> | |
%link(href="/css/layout.css" media="screen" rel="stylesheet") | |
<!--<![endif]--> | |
/[if lte IE 6] | |
%link(rel="stylesheet" href="http://universal-ie6-css.googlecode.com/files/ie6.1.1.css" media="screen, projection") | |
/[if lt IE 9] | |
%script(src="//html5shim.googlecode.com/svn/trunk/html5.js") | |
= local_stylesheet_link_tag('local') | |
%link(href="/articles.xml" rel="alternate" type="application/atom+xml") | |
%body | |
#container | |
= haml :header, :layout => false | |
= yield | |
= haml :footer, :layout => false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// themes/theme-name/views/layout.sass | |
/* Notice the .sass extension. | |
* You can use .scss as long as your file is formatted properly. | |
*/ | |
@import "blueprint" | |
/* | |
// Below are examples on how to import specific compass mixins/utilities | |
@import "compass/reset" | |
@import "compass/utilities/general/clearfix" | |
@import "compass/css3" | |
*/ | |
+blueprint | |
$customVar = #FFF | |
/* Begin custom styles below */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment