Skip to content

Commit

Permalink
Initial Import.
Browse files Browse the repository at this point in the history
  • Loading branch information
rizwanreza committed Dec 24, 2009
0 parents commit 330d1f2
Show file tree
Hide file tree
Showing 6 changed files with 74 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -0,0 +1 @@
.sass_cache/*
21 changes: 21 additions & 0 deletions README.textile
@@ -0,0 +1,21 @@
h1. Reloader

This is a painless boilerplate code to start designing Web sites in "Haml":http://haml-lang.com/, "Sass":http://sass-lang.com/ and "Compass":http://compass-style.org/.

h2. Dependencies

You'd want to install the following dependencies to get the engines running.

@sudo gem install sinatra shotgun haml compass@

h2. Rollin' it

Open up Terminal and fire up @shotgun site.rb@. Browsers will now answer to every refresh with reloaded styles. Open up @views@ in your favorite text editor and you're ready to go.

That's all there is to it.

h2. Why?

This is supposed to be a helping tool during designing web pages. The files would probably be copied manually outside somewhere when finished.

I use this to design my websites before coding anything, helping me focus on design by just refreshing the page (like old-school HTML/CSS).
34 changes: 34 additions & 0 deletions site.rb
@@ -0,0 +1,34 @@
# You should be up and running without editing this file.

require "rubygems"
require "sinatra"
require "Haml"
require "Sass"
require "compass"

configure do
Compass.configuration do |config|
config.project_path = File.dirname(__FILE__)
config.sass_dir = 'views'
config.output_style = :compact
end

set :haml, { :format => :html5 }
set :sass, Compass.sass_engine_options
end

get '/' do
haml :index
end

get '/stylesheet.css' do
headers 'Content-Type' => 'text/css; charset=utf-8'
sass :stylesheet
end

# This adds another page.
# Create about.haml in views.

# get '/about' do
# haml :about
# end
8 changes: 8 additions & 0 deletions views/_base.sass
@@ -0,0 +1,8 @@
// This file contains common variables and mixins you'd like to use
// in stylesheet.sass.
//
// Import your compass frameworks here.
// @import compass/reset.sass
// @import compass/utilities.sass
// @import blueprint/screen.sass
7 changes: 7 additions & 0 deletions views/index.haml
@@ -0,0 +1,7 @@
!!! html
%html
%head
%link{:href => '/stylesheet.css', :media => 'screen', :rel => 'stylesheet', :type => 'text/css'}

%body
Hello from 'live-refreshing' Haml/Sass.
3 changes: 3 additions & 0 deletions views/stylesheet.sass
@@ -0,0 +1,3 @@
// This is where the main styles would go.
@import _base.sass

0 comments on commit 330d1f2

Please sign in to comment.