Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
161 additions
and
6 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
require 'rubygems' | ||
require 'sinatra' | ||
require 'haml' | ||
|
||
set :haml, { :format => :html5 } | ||
|
||
get '/' do | ||
haml :index | ||
end | ||
|
||
__END__ | ||
|
||
@@ layout | ||
!!! | ||
%html | ||
%head | ||
%title PDXRB RULES! | ||
%body= yield | ||
|
||
@@ index | ||
#index | ||
Um, hi there. |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
require 'rubygems' | ||
require 'sinatra' | ||
require 'haml' | ||
require 'sass' | ||
|
||
set :haml, { :format => :html5 } | ||
|
||
get '/' do | ||
haml :index | ||
end | ||
|
||
get '/styles.css' do | ||
content_type 'text/css', :charset => 'utf-8' | ||
sass :styles | ||
end |
Binary file not shown.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#index | ||
Um, hi there. | ||
|
||
.explanation | ||
views/ contains haml & sass files | ||
.explanation | ||
public/ has all the static files (just like Rails) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
!!! | ||
%html | ||
%head | ||
%title PDXRB RULES! | ||
%link{ :rel => :stylesheet, :href => '/styles.css' } | ||
%body= yield |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#index | ||
:background-color #ccc | ||
:border 1px solid #666 | ||
|
||
.explanation | ||
:border 2px dashed #f00 | ||
:margin 10px 0 |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
!SLIDE smaller | ||
# What about Haml? # | ||
|
||
@@@ ruby | ||
|
||
require 'rubygems' | ||
require 'sinatra' | ||
require 'haml' | ||
|
||
set :haml, { :format => :html5 } | ||
|
||
get '/' do | ||
haml :index | ||
end | ||
|
||
!SLIDE | ||
:index can either be in (by default) views/ or in-file. | ||
|
||
!SLIDE smaller | ||
|
||
@@@ ruby | ||
... | ||
|
||
get '/' do | ||
haml :index | ||
end | ||
|
||
__END__ | ||
|
||
@@ layout | ||
!!! | ||
%html | ||
%head | ||
%title PDXRB RULES! | ||
%body= yield | ||
|
||
@@ index | ||
#index | ||
Um, hi there. | ||
|
||
!SLIDE smaller | ||
# Normal layout/template method # | ||
## examples/normal_haml/app.rb ## | ||
@@@ ruby | ||
|
||
require 'rubygems' | ||
require 'sinatra' | ||
require 'haml' | ||
require 'sass' | ||
|
||
set :haml, { :format => :html5 } | ||
|
||
get '/' do | ||
haml :index | ||
end | ||
|
||
get '/styles.css' do | ||
content_type 'text/css', :charset => 'utf-8' | ||
sass :styles | ||
end | ||
|
||
!SLIDE smaller | ||
# The Views # | ||
## examples/normal_haml/views/* ## | ||
|
||
!SLIDE smaller | ||
# examples/normal_haml/views/layout.haml # | ||
!!! | ||
%html | ||
%head | ||
%title PDXRB RULES! | ||
%link{ :rel => :stylesheet, :href => '/styles.css' } | ||
%body= yield | ||
|
||
!SLIDE smaller | ||
# examples/normal_haml/views/index.haml # | ||
|
||
#index | ||
Um, hi there. | ||
|
||
.explanation | ||
views/ contains haml & sass files | ||
.explanation | ||
public/ has all the static files (just like Rails) | ||
|
||
!SLIDE smaller | ||
# examples/normal_haml/views/styles.sass # | ||
|
||
#index | ||
:background-color #ccc | ||
:border 1px solid #666 | ||
|
||
.explanation | ||
:border 2px dashed #f00 | ||
:margin 10px 0 |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
[ | ||
{ "section" : "title" }, | ||
{ "section" : "about_me" }, | ||
{ "section" : "sinatra" } | ||
{ "section" : "sinatra" }, | ||
{ "section" : "haml" } | ||
] |
This file contains 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