Created
December 17, 2008 22:53
-
-
Save cristibalan/37282 to your computer and use it in GitHub Desktop.
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
# todo |
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
// put me in views/stylesheets/_mixins.sass | |
=image_replace(!width, !height, !url) | |
display: block | |
width= !width | |
height= !height | |
background= url(!url) left top no-repeat | |
text-indent: -999em | |
-moz-outline: none |
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
# put me in frankly.rb | |
require 'rubygems' | |
$:.unshift File.dirname(__FILE__) + '/sinatra/lib' | |
$:.unshift File.dirname(__FILE__) + '/vendor/haml/lib' | |
require 'sinatra' | |
get '/stylesheets/:name.css' do | |
content_type 'text/css', :charset => 'utf-8' | |
sass "stylesheets/#{params["name"]}".to_sym, :style => :expanded, :load_paths => ["views/stylesheets"] | |
end | |
get '/*' do | |
name = params["splat"][0] | |
name = "index" if name.empty? | |
haml name.to_sym | |
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
/ put me in views/index.haml | |
!!! | |
%html | |
%head | |
%meta{ 'http-equiv' => 'Content-Type', :content => 'text/html; charset=UTF-8' } | |
%title frankly | |
%link{ :media => 'screen', :type => 'text/css', :href => '/stylesheets/index.css', :rel => 'stylesheet' } | |
%body | |
%h1 | |
frankly | |
%p | |
frankly, braid is pretty sassy |
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
// put me in views/stylesheets/index.sass | |
@import _mixins.sass | |
body | |
h1 | |
+image_replace(185px, 135px, "http://upload.wikimedia.org/wikipedia/commons/thumb/d/d5/Franksinatrawalkoffame.jpg/180px-Franksinatrawalkoffame.jpg") | |
margin: 2em auto | |
p | |
font-style: italic |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment