Add webp to our image type lists
This commit is contained in:
parent
2b928a326c
commit
fae0e00f42
|
@ -178,7 +178,7 @@ module Middleman::Cli
|
|||
# @return [void]
|
||||
def execute!
|
||||
# Sort order, images, fonts, js/css and finally everything else.
|
||||
sort_order = %w(.png .jpeg .jpg .gif .bmp .svg .svgz .ico .woff .otf .ttf .eot .js .css)
|
||||
sort_order = %w(.png .jpeg .jpg .gif .bmp .svg .svgz .ico .webp .woff .otf .ttf .eot .js .css)
|
||||
|
||||
# Pre-request CSS to give Compass a chance to build sprites
|
||||
logger.debug '== Prerendering CSS'
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require 'middleman-core/util'
|
||||
|
||||
class Middleman::Extensions::AssetHash < ::Middleman::Extension
|
||||
option :exts, %w(.jpg .jpeg .png .gif .js .css .otf .woff .eot .ttf .svg), 'List of extensions that get asset hashes appended to them.'
|
||||
option :exts, %w(.jpg .jpeg .png .gif .webp .js .css .otf .woff .eot .ttf .svg .svgz), 'List of extensions that get asset hashes appended to them.'
|
||||
option :ignore, [], 'Patterns to avoid adding asset hashes to'
|
||||
|
||||
def initialize(app, options_hash={}, &block)
|
||||
|
|
|
@ -24,7 +24,7 @@ class Middleman::Extensions::CacheBuster < ::Middleman::Extension
|
|||
def asset_url(path, prefix='')
|
||||
http_path = super
|
||||
|
||||
if http_path.include?('://') || !%w(.css .png .jpg .jpeg .svg .svgz .js .gif).include?(File.extname(http_path))
|
||||
if http_path.include?('://') || !%w(.css .png .jpg .jpeg .svg .svgz .webp .js .gif).include?(File.extname(http_path))
|
||||
http_path
|
||||
else
|
||||
if respond_to?(:http_images_path) && prefix == http_images_path
|
||||
|
|
Loading…
Reference in a new issue