2010-01-21 06:25:44 +00:00
|
|
|
#!/usr/bin/env ruby
|
|
|
|
|
|
|
|
require 'compass'
|
2010-01-31 17:43:19 +00:00
|
|
|
|
|
|
|
Compass.add_configuration "#{File.dirname(__FILE__)}/.compass/config.rb"
|
2010-01-21 06:25:44 +00:00
|
|
|
|
2010-11-22 01:11:43 +00:00
|
|
|
SITE_ROOT = ""
|
2010-01-28 09:11:42 +00:00
|
|
|
|
2010-01-27 07:05:57 +00:00
|
|
|
compile '/assets/*/' do
|
2010-01-24 09:34:05 +00:00
|
|
|
nil
|
|
|
|
end
|
|
|
|
|
2010-04-20 18:09:09 +00:00
|
|
|
['markup', 'stylesheet', 'background'].each do |ex_file|
|
|
|
|
compile "/examples/*/#{ex_file}/" do
|
2010-03-28 09:49:58 +00:00
|
|
|
nil
|
|
|
|
end
|
2010-01-27 06:08:13 +00:00
|
|
|
end
|
|
|
|
|
2010-04-20 18:09:09 +00:00
|
|
|
compile '/' do
|
|
|
|
filter :haml, :ugly => true
|
|
|
|
layout 'main'
|
|
|
|
end
|
|
|
|
|
2010-05-08 18:07:31 +00:00
|
|
|
compile '/search-data/' do
|
|
|
|
filter :erb
|
|
|
|
end
|
|
|
|
|
2010-01-27 06:08:13 +00:00
|
|
|
compile '/examples/*/' do
|
|
|
|
filter :haml, :ugly => true
|
2010-11-15 22:41:45 +00:00
|
|
|
filter :highlight
|
2010-01-27 06:08:13 +00:00
|
|
|
layout 'example'
|
|
|
|
end
|
|
|
|
|
2010-04-20 18:09:09 +00:00
|
|
|
sass_options = Compass.sass_engine_options
|
|
|
|
|
|
|
|
(0..5).each do |i|
|
|
|
|
compile("/stylesheets/#{'*/' * i}_*/") {nil}
|
|
|
|
end
|
|
|
|
|
|
|
|
compile '/stylesheets/*' do
|
|
|
|
filter :sass, sass_options.merge(:syntax => item[:extension].to_sym)
|
2010-01-21 06:25:44 +00:00
|
|
|
end
|
|
|
|
|
2010-02-07 21:58:52 +00:00
|
|
|
compile '/reference/*/' do
|
|
|
|
filter :haml, :ugly => true
|
2010-11-15 22:41:45 +00:00
|
|
|
filter :highlight
|
2010-04-21 05:43:25 +00:00
|
|
|
layout item[:layout] || 'main'
|
2010-02-07 21:58:52 +00:00
|
|
|
end
|
|
|
|
|
2010-01-21 06:25:44 +00:00
|
|
|
compile '*' do
|
2010-04-25 18:28:03 +00:00
|
|
|
if item[:extension] == "markdown"
|
|
|
|
filter :rdiscount
|
|
|
|
elsif item[:extension] == "haml"
|
|
|
|
filter :haml, :ugly => true
|
|
|
|
end
|
2010-04-24 17:03:34 +00:00
|
|
|
layout item[:layout] || 'main'
|
2010-01-21 06:25:44 +00:00
|
|
|
end
|
|
|
|
|
2010-05-08 18:07:31 +00:00
|
|
|
route '/search-data/' do
|
|
|
|
"#{SITE_ROOT}/javascripts"+item.identifier[0..-2]+".js"
|
|
|
|
end
|
|
|
|
|
2010-04-20 18:09:09 +00:00
|
|
|
(0..5).each do |i|
|
|
|
|
route("/stylesheets/#{'*/' * i}_*/") {nil}
|
2010-01-21 06:25:44 +00:00
|
|
|
end
|
2010-01-23 09:08:00 +00:00
|
|
|
|
2010-01-27 07:05:57 +00:00
|
|
|
route '/assets/css/*/' do
|
2010-01-28 09:11:42 +00:00
|
|
|
"#{SITE_ROOT}/stylesheets"+item.identifier.chop[11..-1]+"."+item[:extension]
|
2010-01-23 09:08:00 +00:00
|
|
|
end
|
|
|
|
|
2010-01-27 07:05:57 +00:00
|
|
|
route '/assets/images/*/' do
|
2010-01-28 09:11:42 +00:00
|
|
|
SITE_ROOT+item.identifier.chop[7..-1]+"."+item[:extension]
|
2010-01-24 09:34:05 +00:00
|
|
|
end
|
|
|
|
|
2010-01-27 07:05:57 +00:00
|
|
|
route '/assets/javascripts/*/' do
|
2010-01-28 09:11:42 +00:00
|
|
|
SITE_ROOT+item.identifier.chop[7..-1]+"."+item[:extension]
|
2010-01-23 09:08:00 +00:00
|
|
|
end
|
|
|
|
|
2010-03-29 06:53:57 +00:00
|
|
|
route '/assets/fonts/*/' do
|
|
|
|
SITE_ROOT+item.identifier.chop[7..-1]+"."+item[:extension]
|
|
|
|
end
|
|
|
|
|
2010-01-21 06:25:44 +00:00
|
|
|
route '/stylesheets/*/' do
|
|
|
|
# don't generate a directory like we do for HTML files
|
2010-01-28 09:11:42 +00:00
|
|
|
SITE_ROOT+item.identifier.chop + '.css'
|
2010-01-21 06:25:44 +00:00
|
|
|
end
|
|
|
|
|
2010-04-21 05:43:25 +00:00
|
|
|
%w(markup stylesheet background).each do |ex_file|
|
|
|
|
route "/examples/*/#{ex_file}/" do
|
2010-03-28 09:49:58 +00:00
|
|
|
nil
|
|
|
|
end
|
2010-01-27 06:08:13 +00:00
|
|
|
end
|
|
|
|
|
2010-01-21 06:25:44 +00:00
|
|
|
route '*' do
|
2010-01-28 09:11:42 +00:00
|
|
|
SITE_ROOT+item.identifier + 'index.html'
|
2010-01-21 06:25:44 +00:00
|
|
|
end
|
|
|
|
|
2010-01-23 02:15:04 +00:00
|
|
|
layout '*', :haml, :ugly => true
|