diff --git a/lib/jekyll/convertible.rb b/lib/jekyll/convertible.rb index 8c8a14d0..15112328 100644 --- a/lib/jekyll/convertible.rb +++ b/lib/jekyll/convertible.rb @@ -143,7 +143,21 @@ module Jekyll # Returns true if the extname belongs to the set of extensions # that asset files use. def asset_file? - %w[.sass .scss .coffee].include?(ext) + sass_file? || coffeescript_file? + end + + # Determine whether the document is a Sass file. + # + # Returns true if extname == .sass or .scss, false otherwise. + def sass_file? + %w[.sass .scss].include?(extname) + end + + # Determine whether the document is a CoffeeScript file. + # + # Returns true if extname == .coffee, false otherwise. + def coffeescript_file? + '.coffee'.eql?(extname) end # Determine whether the file should be rendered with Liquid. @@ -151,7 +165,7 @@ module Jekyll # Returns false if the document is either an asset file or a yaml file, # true otherwise. def render_with_liquid? - !asset_file? + !coffeescript_file? end # Determine whether the file should be placed into layouts. diff --git a/lib/jekyll/document.rb b/lib/jekyll/document.rb index 3840375c..ccb20aee 100644 --- a/lib/jekyll/document.rb +++ b/lib/jekyll/document.rb @@ -80,7 +80,21 @@ module Jekyll # Returns true if the extname belongs to the set of extensions # that asset files use. def asset_file? - %w[.sass .scss .coffee].include?(extname) + sass_file? || coffeescript_file? + end + + # Determine whether the document is a Sass file. + # + # Returns true if extname == .sass or .scss, false otherwise. + def sass_file? + %w[.sass .scss].include?(extname) + end + + # Determine whether the document is a CoffeeScript file. + # + # Returns true if extname == .coffee, false otherwise. + def coffeescript_file? + '.coffee'.eql?(extname) end # Determine whether the document has a YAML header. @@ -96,7 +110,7 @@ module Jekyll # Returns false if the document is either an asset file or a yaml file, # true otherwise. def render_with_liquid? - !(asset_file? || yaml_file?) && has_yaml_header? + !(coffeescript_file? || yaml_file?) && has_yaml_header? end # Determine whether the file should be placed into layouts.