compass/doc-src/Rules

89 lines
1.7 KiB
Plaintext
Raw Normal View History

2010-01-21 06:25:44 +00:00
#!/usr/bin/env ruby
require 'compass'
2010-01-31 17:43:19 +00:00
puts "Compass running from: #{Compass.lib_directory}"
Compass.add_configuration "#{File.dirname(__FILE__)}/.compass/config.rb"
2010-01-21 06:25:44 +00:00
SITE_ROOT = "/docs"
2010-01-28 09:11:42 +00:00
compile '/assets/*/' do
2010-01-24 09:34:05 +00:00
nil
end
['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
compile '/' do
filter :haml, :ugly => true
layout 'main'
end
2010-01-27 06:08:13 +00:00
compile '/examples/*/' do
filter :haml, :ugly => true
2010-02-07 21:58:52 +00:00
filter :highlight if ENV['SYNTAX']
2010-01-27 06:08:13 +00:00
layout 'example'
end
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
filter :highlight if ENV['SYNTAX']
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-01-23 02:15:04 +00:00
filter :haml, :ugly => true
2010-04-24 17:03:34 +00:00
layout item[:layout] || 'main'
2010-01-21 06:25:44 +00:00
end
(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
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
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
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