Skip to content

Commit 481bf53

Browse files
author
Jason Fox
committed
cleaned up the layout and javascript loading and
1 parent 929f3fa commit 481bf53

File tree

10 files changed

+1444
-13
lines changed

10 files changed

+1444
-13
lines changed

config.ru

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Encoding: utf-8
2-
2+
Encoding.default_internal = Encoding::UTF_8
33
require 'bundler/setup'
44

55
require File.join(File.dirname(__FILE__), 'lib/app')

lib/app/server.rb

+16
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22

33
require 'slim'
44
require 'sinatra'
5+
require 'compass'
56
require 'sinatra/config_file'
67
require 'sinatra/assetpack'
8+
require 'zurb-foundation'
79

810
module App
911
class Server < Sinatra::Base
@@ -15,19 +17,33 @@ class Server < Sinatra::Base
1517
# Configuration
1618
config_file 'config/config.yml'
1719

20+
Compass.configuration do |c|
21+
c.project_path = root
22+
c.sass_dir = 'assets/stylesheets'
23+
c.images_dir = 'assets/images'
24+
c.http_generated_images_path = '/img'
25+
c.add_import_path 'assets/stylesheets'
26+
end
27+
28+
set :scss, Compass.sass_engine_options
29+
1830
# Assets
1931
assets do
2032
serve '/js', from: 'assets/javascripts'
33+
# We serve foundation specific javascript right from the gem
34+
serve '/foundation', from: Foundation.js_path
2135
serve '/css', from: 'assets/stylesheets'
2236
serve '/img', from: 'assets/images'
2337

2438
# Javascript placed before the closing <head> tag
2539
js :head, [
40+
'/foundation/vendor/custom.modernizr.js',
2641
'/js/head.js'
2742
]
2843

2944
# Javascript placed before the closing <body> tag
3045
js :tail, [
46+
'/foundation/foundation/foundation.js',
3147
'/js/tail.js'
3248
]
3349

lib/assets/javascripts/tail.js

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
2+
$(document).foundation();

0 commit comments

Comments
 (0)