From 39e00b53ae895c8575172c3e2099e7c912f85ce7 Mon Sep 17 00:00:00 2001 From: Adam Stacoviak Date: Fri, 19 Nov 2010 02:44:11 -0600 Subject: [PATCH] New updates for Compass, layouts, and some organization --- app.rb | 6 +++--- views/_nav_main.haml | 5 +++++ views/layouts/application.haml | 3 ++- views/layouts/page.haml | 17 ++++++++++++++--- views/stylesheets/application.sass | 4 +++- 5 files changed, 27 insertions(+), 8 deletions(-) create mode 100644 views/_nav_main.haml diff --git a/app.rb b/app.rb index 06aa64b..eded321 100755 --- a/app.rb +++ b/app.rb @@ -17,14 +17,14 @@ # Configure Compass configure do - Compass.configuration.parse(File.join(Sinatra::Application.root, 'config.rb')) + Compass.add_project_configuration(File.join(Sinatra::Application.root, 'config.rb')) end # At a minimum the main sass file must reside within the views directory # We create /views/stylesheets where all our sass files can safely reside -get '/stylesheets/:name.css' do +get '/stylesheets/:file.css' do content_type 'text/css', :charset => 'utf-8' - sass(:"stylesheets/#{params[:name]}", Compass.sass_engine_options) + sass(:"stylesheets/#{params[:file]}", Compass.sass_engine_options) end get '/about' do diff --git a/views/_nav_main.haml b/views/_nav_main.haml new file mode 100644 index 0000000..ee27d68 --- /dev/null +++ b/views/_nav_main.haml @@ -0,0 +1,5 @@ +%ul + %li + %a{:href => "/"} Home + %li + %a{:href => "/about"} About \ No newline at end of file diff --git a/views/layouts/application.haml b/views/layouts/application.haml index 1dff414..29f8081 100755 --- a/views/layouts/application.haml +++ b/views/layouts/application.haml @@ -1,4 +1,4 @@ -!!! Strict +!!! 5 %html{html_attrs('en-en')} %head %meta{:'http-equiv' => "Content-Type", :content => "text/html; charset=utf-8"} @@ -9,5 +9,6 @@ %script{:type => "text/javascript", :src => "javascripts/plugins/jquery.qtip-1.0.0-rc3.min.js"} %script{:type => "text/javascript", :src => "javascripts/site.js"} %body + = partial :_nav_main = yield = partial :_analytics \ No newline at end of file diff --git a/views/layouts/page.haml b/views/layouts/page.haml index 989b0be..29f8081 100644 --- a/views/layouts/page.haml +++ b/views/layouts/page.haml @@ -1,3 +1,14 @@ -%p This is the 'alternate.haml' - -= yield \ No newline at end of file +!!! 5 +%html{html_attrs('en-en')} + %head + %meta{:'http-equiv' => "Content-Type", :content => "text/html; charset=utf-8"} + %meta{:name => "lang", :content => "en"} + %title Sinatra Bootstrap + %link{:href=>'stylesheets/application.css', :rel => 'stylesheet', :media => "screen", :type => "text/css"} + %script{:type => "text/javascript", :src => "http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"} + %script{:type => "text/javascript", :src => "javascripts/plugins/jquery.qtip-1.0.0-rc3.min.js"} + %script{:type => "text/javascript", :src => "javascripts/site.js"} + %body + = partial :_nav_main + = yield + = partial :_analytics \ No newline at end of file diff --git a/views/stylesheets/application.sass b/views/stylesheets/application.sass index 921d9b6..4888fd9 100755 --- a/views/stylesheets/application.sass +++ b/views/stylesheets/application.sass @@ -1,5 +1,7 @@ -@import blueprint/reset +@import compass/reset +@include reset-html5 @import compass/utilities +@import compass/css3 // Base font =base-font