move actual type detection to sprockets
This commit is contained in:
parent
6a3d2e7e4e
commit
c7922c4a35
|
@ -28,9 +28,6 @@ module Middleman
|
||||||
Contract None => Hash
|
Contract None => Hash
|
||||||
attr_reader :options
|
attr_reader :options
|
||||||
|
|
||||||
IMAGE_EXTENSIONS = %w(.png .jpg .jpeg .webp .svg .svgz .gif)
|
|
||||||
FONT_EXTENSIONS = %w(.otf .woff .eot .ttf)
|
|
||||||
|
|
||||||
# Construct a new SourceWatcher
|
# Construct a new SourceWatcher
|
||||||
#
|
#
|
||||||
# @param [Middleman::Sources] parent The parent collection.
|
# @param [Middleman::Sources] parent The parent collection.
|
||||||
|
@ -270,11 +267,6 @@ module Middleman
|
||||||
def path_to_source_file(path)
|
def path_to_source_file(path)
|
||||||
types = Set.new([@type])
|
types = Set.new([@type])
|
||||||
|
|
||||||
if @type == :source
|
|
||||||
types << :image if IMAGE_EXTENSIONS.include?(path.extname)
|
|
||||||
types << :font if FONT_EXTENSIONS.include?(path.extname)
|
|
||||||
end
|
|
||||||
|
|
||||||
::Middleman::SourceFile.new(
|
::Middleman::SourceFile.new(
|
||||||
path.relative_path_from(@directory), path, @directory, types)
|
path.relative_path_from(@directory), path, @directory, types)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue