Add webp to our image type lists

This commit is contained in:
Thomas Reynolds 2014-08-14 09:04:26 -07:00
parent 2b928a326c
commit fae0e00f42
3 changed files with 3 additions and 3 deletions

View file

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

View file

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

View file

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