Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Bump to version 1.0.0

* Update to proper Compass setup
* Add blank readme
* Support grid-coordinates 1.0.4
* Add VERSION file for tracking the version
  • Loading branch information...
commit f6b4bab8d8ca09521e308550834ef74483454c0c 1 parent cb6becf
Adam Stacoviak authored
View
0  README.markdown
No changes.
View
1  VERSION
@@ -0,0 +1 @@
+1.0.0
View
25 sinatra-sings.rb → app.rb
@@ -1,35 +1,36 @@
# Load before Sinatra
require 'rubygems'
-require 'compass'
+require 'compass' # must be loaded before sinatra
# Load Sinatra
require 'sinatra'
+require 'lib/render_partial'
# Load after Sinatra
-require 'grid-coordinates'
-require 'haml'
+require 'haml' # must be loaded after sinatra
# Set Sinatra's variables
set :app_file, __FILE__
set :root, File.dirname(__FILE__)
-set :views, "views"
+set :views, 'views'
+set :public, 'public'
# Configure Compass
configure do
- Compass.configuration do |config|
- config.project_path = File.dirname(__FILE__)
- config.sass_dir = File.join(Sinatra::Application.views, 'stylesheets')
- config.output_style = :compact
- end
+ Compass.configuration.parse(File.join(Sinatra::Application.root, 'config', 'compass.config'))
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
content_type 'text/css', :charset => 'utf-8'
- sass :"stylesheets/#{params[:name]}", :sass => Compass.sass_engine_options
+ sass(:"stylesheets/#{params[:name]}", Compass.sass_engine_options)
end
-get '/' do
- haml :index
+get '/about' do
+ haml :about, :layout => :'layouts/page'
end
+
+get '/' do
+ haml :index, :layout => :'layouts/application'
+end
View
10 config.ru
@@ -1,9 +1,5 @@
require 'rubygems'
require 'sinatra'
-Sinatra::Application.default_options.merge!(
-:run => false,
-:enf => :production
-)
-require 'sinatra-sings.rb'
-run Sinatra::Application
-
+Sinatra::Application.default_options.merge!(:run => false, :enf => :production)
+require 'bootstrap.rb'
+run Sinatra::Application
View
20 config/compass.config
@@ -0,0 +1,20 @@
+require 'grid-coordinates'
+
+if defined?(Sinatra)
+ # This is the configuration to use when running within sinatra
+ project_path = Sinatra::Application.root
+ environment = :development
+else
+ # this is the configuration to use when running within the compass command line tool.
+ css_dir = File.join 'public', 'stylesheets'
+ relative_assets = true
+ environment = :production
+end
+
+# This is common configuration
+sass_dir = File.join 'views', 'stylesheets'
+images_dir = File.join 'public', 'images'
+http_path = "/"
+http_images_path = "/images"
+http_stylesheets_path = "/stylesheets"
+output_style = :expanded #compressed #nested #compact
View
12 lib/render_partial.rb
@@ -0,0 +1,12 @@
+# Borrowed from Tanner Burson: http://github.com/tannerburson
+# http://github.com/adamstac/sinatra-plugins/blob/master/render_partial.rb
+
+module Sinatra
+ module RenderPartial
+ def partial(page, options={})
+ haml page, options.merge!(:layout => false)
+ end
+ end
+
+ helpers RenderPartial
+end
View
15 public/javascripts/site.js
@@ -1,23 +1,10 @@
$(document).ready(function() {
- // I'm on the outside
+ // Open external links in a new window
hostname = window.location.hostname
$("a[href^=http]")
.not("a[href*='" + hostname + "']")
.addClass('link external')
.attr('target', '_blank');
-
- $('#nav_main li').each(function() {
-
- // Iterate over each with .qtip()
- $(this).qtip({
- show: { solo: true, ready: false, effect: { type: 'slide', length: 250 } },
- hide: { fixed: true, effect: { type: 'slide', length: 50 } },
- content: { text: $(this).find('.tooltip') },
- position: { adjust: { screen: true }, corner: { target: 'bottomLeft', tooltip: 'topLeft' } },
- style: { width: 300, padding: 15, background: '#333', color: 'white', border: { width: 1, color: '#333' } }
- });
-
- });
});
View
1  views/_analytics.haml
@@ -0,0 +1 @@
+/ Analytics code
View
1  views/about.haml
@@ -0,0 +1 @@
+%h2 About this site
View
2  views/index.haml
@@ -1 +1 @@
-
+%p This is the homepage
View
20 views/layout.haml
@@ -1,20 +0,0 @@
-!!! Strict
-%html{html_attrs('en-en')}
- %head
- %meta{:'http-equiv' => "Content-Type", :content => "text/html; charset=utf-8"}
- %meta{:name => "lang", :content => "en"}
- %title Proving Grounds
- %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
- .wrap
- #content
- #nav_main
- %ul
- - 5.times do
- %li
- %a{:href => "/"} About Us
- .tooltip
- %p Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
View
13 views/layouts/application.haml
@@ -0,0 +1,13 @@
+!!! Strict
+%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
+ = yield
+ = partial :_analytics
View
3  views/layouts/page.haml
@@ -0,0 +1,3 @@
+%p This is the 'alternate.haml'
+
+= yield
View
87 views/stylesheets/_grid.sass
@@ -1,87 +0,0 @@
-// The following locks in our grid coordinates
-
-!grid_width ||= 960px
-!grid_columns ||= 12
-!grid_pixels ||= 60px
-!grid_gutter_width ||= 20px
-
-=grid(!grid_columns)
- +column
- @if !grid_columns == 1
- width = !grid_pixels
- @else
- width = (!grid_columns * !grid_pixels) + (!grid_columns * !grid_gutter_width - !grid_gutter_width)
-
-=column
- +float-left
- margin = 0 !grid_gutter_width / 2
- overflow: hidden
-
-=grid-container(!nested = "nil")
- @if !nested == "nested"
- margin: 0
- left = -!grid_gutter_width / 2
- right = -!grid_gutter_width / 2
- display: inline-block
- width: auto
- @else
- margin: 0 auto
- overflow: hidden
- width = !grid_width
-
-=grid-prefix(!grid_columns)
- @if !grid_columns == 1
- padding-left = !grid_pixels + !grid_gutter_width
- @else
- padding-left = (!grid_columns * !grid_pixels) + (!grid_columns * !grid_gutter_width)
-
-=grid-suffix(!grid_columns)
- @if !grid_columns == 1
- padding-right = !grid_pixels + !grid_gutter_width
- @else
- padding-right = (!grid_columns * !grid_pixels) + (!grid_columns * !grid_gutter_width)
-
-=grid-full
- +grid(!grid_columns)
-
-.grid_container
- +grid-container
- &.nested
- +grid-container("nested")
- .grid
- &.one
- +grid(1)
- &.two
- +grid(2)
- &.three
- +grid(3)
- &.four
- +grid(4)
- &.five
- +grid(5)
- &.six
- +grid(6)
- &.seven
- +grid(7)
- &.eight
- +grid(8)
- &.nine
- +grid(9)
- &.ten
- +grid(10)
- &.eleven
- +grid(11)
- &.twelve
- +grid(12)
- &.full
- +grid-full
-
- // Example styling for prototyping a grid with text labels
- // As seen here: http://flickr.com/ ...#TODO
- .example
- p
- background: #333 !important
- border: 1px solid #000 !important
- color: #fff !important
- line-height: 70px !important
- text-align: center !important
View
1  views/stylesheets/_lib.sass
@@ -0,0 +1 @@
+@import lib/grid
View
1  views/stylesheets/_library.sass
@@ -1 +0,0 @@
-@import library/border_radius, library/utilities, library/grid
View
54 views/stylesheets/application.sass
@@ -1,6 +1,6 @@
@import blueprint/reset
@import compass/utilities
-@import grid, library
+@import lib/grid
// Base font
=base-font
@@ -27,54 +27,4 @@ body
+base-font
background: #fff
color: #0d0d0d
-
-.wrap
- +grid-container
- #content
- +grid(8)
- +grid-prefix(2)
- +grid-suffix(2)
- margin-top: 100px
-
-#nav_main
- +clearfix
- background: #aaa
- ul, li
- +float-left
- li
- margin-right: 4px
- a
- background: #ddd
- display: block
- line-height: 34px
- padding: 0 20px
- text-decoration: none
- .tooltip
- background: #666
- height: 150px
- width: 75px
-
-// Styles for the .feature tooltips
-.tooltip
- display: none
-
-.qtip-content
- // background: #F5F5B5
- // background: rgba(245,245,181,0.95)
- .tooltip
- h2
- font-size: 14px
- margin-bottom: 10px
- p
- font-size: 13px
- line-height: 1.4
- margin-bottom: 10px
- &:last-child
- margin-bottom: 0
- &.read_more
- font-size: 12px
- line-height: 1.1
- a
- font-weight: bold
- &:hover
- text-decoration: underline
+ padding: 20px
View
7 views/stylesheets/lib/_grid.sass
@@ -0,0 +1,7 @@
+@import compass/utilities
+
+!grid_columns ||= 12
+!grid_pixels ||= 60px
+!grid_gutter_width ||= 20px
+
+@import grid-coordinates/grid
View
53 views/stylesheets/library/_border_radius.sass
@@ -1,53 +0,0 @@
-// Border-radius
-=border-radius(!radius)
- border-radius = !radius
- -moz-border-radius = !radius
- -webkit-border-radius = !radius
-
-=border-radius-top(!radius)
- +border-radius-top-left(!radius)
- +border-radius-top-right(!radius)
-
-=border-radius-right(!radius)
- +border-radius-top-right(!radius)
- +border-radius-bottom-right(!radius)
-
-=border-radius-bottom(!radius)
- +border-radius-bottom-right(!radius)
- +border-radius-bottom-left(!radius)
-
-=border-radius-left(!radius)
- +border-radius-top-left(!radius)
- +border-radius-bottom-left(!radius)
-
-=border-radius-top-right(!radius)
- +border-radius-top-right(!radius)
-
-=border-radius-bottom-right(!radius)
- +border-radius-bottom-right(!radius)
-
-=border-radius-bottom-left(!radius)
- +border-radius-bottom-left(!radius)
-
-=border-radius-top-left(!radius)
- +border-radius-top-left(!radius)
-
-=border-radius-top-right(!radius)
- border-top-right-radius = !radius
- -moz-border-radius-topright = !radius
- -webkit-border-top-right-radius = !radius
-
-=border-radius-bottom-right(!radius)
- border-bottom-right-radius = !radius
- -moz-border-radius-bottomright = !radius
- -webkit-border-bottom-right-radius = !radius
-
-=border-radius-bottom-left(!radius)
- border-bottom-left-radius = !radius
- -moz-border-radius-bottomleft = !radius
- -webkit-border-bottom-left-radius = !radius
-
-=border-radius-top-left(!radius)
- border-top-left-radius = !radius
- -moz-border-radius-topleft = !radius
- -webkit-border-top-left-radius = !radius
View
18 views/stylesheets/library/_utilities.sass
@@ -1,18 +0,0 @@
-// Mixins
-=centered
- margin-left: auto !important
- margin-right: auto !important
- display: block
-
-=float(!direction)
- display: inline
- float = !direction
-
-=min-height(!height)
- min-height = !height
- height: auto !important
- height = !height
-
-// Because the reset doesn't do it
-h1, h2, h3, h4, h5, h6
- font-weight: bold
Please sign in to comment.
Something went wrong with that request. Please try again.