Allow Sass files to be rendered, but never place them in layouts.

Fixes #2573.
This commit is contained in:
Parker Moore 2014-08-12 13:38:53 -04:00
parent 5367bc3416
commit 8ff9074ce5
2 changed files with 32 additions and 4 deletions

View File

@ -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.

View File

@ -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.