Skip to content
Browse files

Allow HAML and SASS to be configured globally

  • Loading branch information...
1 parent 73a7c84 commit 7650be0311f2b8693c4c955715d8d2b908bfd35a @dag dag committed Jun 2, 2008
Showing with 6 additions and 2 deletions.
  1. +4 −0 lib/webby.rb
  2. +1 −1 lib/webby/filters/haml.rb
  3. +1 −1 lib/webby/filters/sass.rb
View
4 lib/webby.rb
@@ -57,6 +57,10 @@ def self.site
:remote_dir => '/not/a/valid/dir',
:rsync_args => %w(-av),
+ # Global options for HAML and SASS
+ :haml_options => {},
+ :sass_options => {},
+
# Options passed to the 'tidy' program when the tidy filter is used
:tidy_options => '-indent -wrap 80',
View
2 lib/webby/filters/haml.rb
@@ -2,7 +2,7 @@
# Render text via the Haml library
Webby::Filters.register :haml do |input, cursor|
- opts = cursor.page.haml_options || {}
+ opts = cursor.page.haml_options || ::Webby.site.haml_options
b = cursor.renderer.get_binding
Haml::Engine.new(input, opts).to_html(b)
end
View
2 lib/webby/filters/sass.rb
@@ -2,7 +2,7 @@
# Render text via the Sass library (part of Haml)
Webby::Filters.register :sass do |input, cursor|
- opts = cursor.page.sass_options || {}
+ opts = cursor.page.sass_options || ::Webby.site.sass_options
Sass::Engine.new(input, opts).render
end

0 comments on commit 7650be0

Please sign in to comment.
Something went wrong with that request. Please try again.