1
0
Fork 0
mirror of https://github.com/middleman/middleman.git synced 2022-11-09 12:20:27 -05:00

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] # @return [void]
def execute! def execute!
# Sort order, images, fonts, js/css and finally everything else. # 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 # Pre-request CSS to give Compass a chance to build sprites
logger.debug '== Prerendering CSS' logger.debug '== Prerendering CSS'

View file

@ -1,7 +1,7 @@
require 'middleman-core/util' require 'middleman-core/util'
class Middleman::Extensions::AssetHash < ::Middleman::Extension 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' option :ignore, [], 'Patterns to avoid adding asset hashes to'
def initialize(app, options_hash={}, &block) def initialize(app, options_hash={}, &block)

View file

@ -24,7 +24,7 @@ class Middleman::Extensions::CacheBuster < ::Middleman::Extension
def asset_url(path, prefix='') def asset_url(path, prefix='')
http_path = super 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 http_path
else else
if respond_to?(:http_images_path) && prefix == http_images_path if respond_to?(:http_images_path) && prefix == http_images_path