Allow Sass files to be rendered, but never place them in layouts.
Fixes #2573.
This commit is contained in:
parent
5367bc3416
commit
8ff9074ce5
|
@ -143,7 +143,21 @@ module Jekyll
|
||||||
# Returns true if the extname belongs to the set of extensions
|
# Returns true if the extname belongs to the set of extensions
|
||||||
# that asset files use.
|
# that asset files use.
|
||||||
def asset_file?
|
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
|
end
|
||||||
|
|
||||||
# Determine whether the file should be rendered with Liquid.
|
# 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,
|
# Returns false if the document is either an asset file or a yaml file,
|
||||||
# true otherwise.
|
# true otherwise.
|
||||||
def render_with_liquid?
|
def render_with_liquid?
|
||||||
!asset_file?
|
!coffeescript_file?
|
||||||
end
|
end
|
||||||
|
|
||||||
# Determine whether the file should be placed into layouts.
|
# Determine whether the file should be placed into layouts.
|
||||||
|
|
|
@ -80,7 +80,21 @@ module Jekyll
|
||||||
# Returns true if the extname belongs to the set of extensions
|
# Returns true if the extname belongs to the set of extensions
|
||||||
# that asset files use.
|
# that asset files use.
|
||||||
def asset_file?
|
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
|
end
|
||||||
|
|
||||||
# Determine whether the document has a YAML header.
|
# 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,
|
# Returns false if the document is either an asset file or a yaml file,
|
||||||
# true otherwise.
|
# true otherwise.
|
||||||
def render_with_liquid?
|
def render_with_liquid?
|
||||||
!(asset_file? || yaml_file?) && has_yaml_header?
|
!(coffeescript_file? || yaml_file?) && has_yaml_header?
|
||||||
end
|
end
|
||||||
|
|
||||||
# Determine whether the file should be placed into layouts.
|
# Determine whether the file should be placed into layouts.
|
||||||
|
|
Loading…
Reference in New Issue