# Ignoring files prevents them from being in the source tree
# Blacklisting prevents them from being rendered to output
Gumdrop.configure do |config|
config.source_dir= '.'
config.output_dir= '../output'
config.data_dir= './data'
config.custom_setting= 'yep'
config.log_level= :debug if config.mode == :test
config.log= config.mode == :test ? 'test.log' : STDOUT
config.relative_paths_exts= %w(.html .htm .css)
end
Gumdrop.ignore %w(output/**/* *.log data/**/* Gemfile Gemfile.lock)
Gumdrop.generate 'robots' do |gen|
gen.page 'robots.txt' do
"ROBOTS!"
end
end
Gumdrop.generate 'sprockets test' do |gen|
gen.file 'js/sprockets-app.js' do
gen.sprockets 'js/sprockets/app.js'
end
Gumdrop.blacklist 'js/sprockets/**/*'
end
Gumdrop.generate 'stitch test' do |gen|
gen.file 'js/stitch-app.js' do
gen.stitch 'js/stitch/app.js'
end
Gumdrop.blacklist 'js/stitch/**/*'
end
Gumdrop.generate 'compressor test (no block param to Gumdrop.generate)' do
# should have the same scope as a .generator file.
shared_js= stitch 'js/stitch/app.js'
file 'js/stitch-app.min.js' do
compress shared_js, :jsmin
end
file 'js/stitch-app.min.src.js' do
shared_js
end
end
Gumdrop.generate 'pages with blocks and layouts' do |gen|
gen.page 'gen-with-block/as-plain.html' do
"Test Plain"
end
gen.page 'gen-with-block/layout-wrap.html', layout:'wrap' do
"Test Wrap"
end
gen.page 'gen-with-block/layout-nested.html', layout:'sub' do
"Test Nested"
end
gen.page 'gen-with-block/layout-nil.html', layout:nil do
"Test Nil"
end
gen.file 'gen-with-block/as-file.html' do
"Test File"
end
gen.file 'gen-with-block/deeper/link-home.html' do
"""
Home
Home
Home
"""
end
gen.file 'gen-with-block/deeper/link-home.css' do
"""
body {
background: url(/logo.png);
background: url('/logo.png');
background: url(\"/logo.png\");
background: url( /logo.png );
background: url( '/logo.png' );
}
"""
end
end